home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / others / nonlin25.zip / NONLIN.DOC < prev    next >
Text File  |  1993-07-29  |  125KB  |  2,549 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.                                    N O N L I N
  7.  
  8.  
  9.  
  10.                       Nonlinear Regression Analysis Program
  11.  
  12.  
  13.  
  14.  
  15.                                Phillip H. Sherrod
  16.  
  17.               Member, Association of Shareware Professionals (ASP)
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.            Nonlin  allows  you  to  perform   statistical   regression
  25.            analyses  to  estimate the values of parameters for linear,
  26.            multivariate,  polynomial,   logistic,   exponential,   and
  27.            general   nonlinear  functions.   The  regression  analysis
  28.            determines the values of the  parameters  which  cause  the
  29.            function  to  best  fit the observed data that you provide.
  30.            Nonlin allows you to specify the function whose  parameters
  31.            are  being estimated using ordinary algebraic notation.  In
  32.            addition to determining  the  parameter  estimates,  Nonlin
  33.            can  be  directed to generate an output file with predicted
  34.            values  and  residuals.   It  can  also   plot   the   data
  35.            observations  and the computed function.  Although designed
  36.            for regression analysis, Nonlin can also be  used  to  find
  37.            the  root  (zero  point)  or  minimum  absolute  value of a
  38.            nonlinear  expression.   Nonlin   is   in   use   at   many
  39.            engineering and research centers around the world.
  40.  
  41.  
  42.  
  43.  
  44.  
  45.                                 Table of Contents
  46.  
  47.  
  48.  
  49.        1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 1
  50.          1.1 Introduction to Regression Analysis . . . . . . . . . . . . 1
  51.          1.2 Introduction to Nonlin  . . . . . . . . . . . . . . . . . . 2
  52.          1.3 Installing Nonlin . . . . . . . . . . . . . . . . . . . . . 3
  53.  
  54.        2. Using Nonlin . . . . . . . . . . . . . . . . . . . . . . . . . 5
  55.          2.1 Function Specification  . . . . . . . . . . . . . . . . . . 6
  56.            2.1.1 Arithmetic Operators  . . . . . . . . . . . . . . . . . 6
  57.            2.1.2 Numeric Constants . . . . . . . . . . . . . . . . . . . 6
  58.            2.1.3 Symbolic Constants  . . . . . . . . . . . . . . . . . . 6
  59.            2.1.4 Built-in Constants  . . . . . . . . . . . . . . . . . . 6
  60.            2.1.5 Built-in Functions  . . . . . . . . . . . . . . . . . . 7
  61.          2.2 Nonlin Command Files  . . . . . . . . . . . . . . . . . .  10
  62.  
  63.        3. Nonlin Commands  . . . . . . . . . . . . . . . . . . . . . .  12
  64.          3.1 TITLE . . . . . . . . . . . . . . . . . . . . . . . . . .  12
  65.          3.2 VARIABLES . . . . . . . . . . . . . . . . . . . . . . . .  12
  66.          3.3 PARAMETERS  . . . . . . . . . . . . . . . . . . . . . . .  12
  67.          3.4 CONFIDENCE  . . . . . . . . . . . . . . . . . . . . . . .  13
  68.          3.5 CONSTANT  . . . . . . . . . . . . . . . . . . . . . . . .  13
  69.          3.6 CONSTRAIN . . . . . . . . . . . . . . . . . . . . . . . .  14
  70.          3.7 COVARIANCE  . . . . . . . . . . . . . . . . . . . . . . .  14
  71.          3.8 SWEEP . . . . . . . . . . . . . . . . . . . . . . . . . .  14
  72.          3.9 FUNCTION  . . . . . . . . . . . . . . . . . . . . . . . .  15
  73.          3.10 TOLERANCE  . . . . . . . . . . . . . . . . . . . . . . .  15
  74.          3.11 ITERATIONS . . . . . . . . . . . . . . . . . . . . . . .  15
  75.          3.12 REGISTER . . . . . . . . . . . . . . . . . . . . . . . .  16
  76.          3.13 OUTPUT . . . . . . . . . . . . . . . . . . . . . . . . .  16
  77.          3.14 POUTPUT  . . . . . . . . . . . . . . . . . . . . . . . .  17
  78.          3.15 PLOT . . . . . . . . . . . . . . . . . . . . . . . . . .  17
  79.          3.16 RPLOT  . . . . . . . . . . . . . . . . . . . . . . . . .  18
  80.          3.17 NPLOT  . . . . . . . . . . . . . . . . . . . . . . . . .  19
  81.          3.18 PRESOLUTION  . . . . . . . . . . . . . . . . . . . . . .  20
  82.          3.19 WIDTH  . . . . . . . . . . . . . . . . . . . . . . . . .  20
  83.          3.20 NOECHO . . . . . . . . . . . . . . . . . . . . . . . . .  20
  84.          3.21 DATA . . . . . . . . . . . . . . . . . . . . . . . . . .  21
  85.  
  86.        4. Understanding The Results  . . . . . . . . . . . . . . . . .  22
  87.          4.1 Descriptive Statistics for Variables  . . . . . . . . . .  22
  88.          4.2 Parameter Estimates . . . . . . . . . . . . . . . . . . .  22
  89.          4.3 t Statistic . . . . . . . . . . . . . . . . . . . . . . .  22
  90.          4.4 Prob(t) . . . . . . . . . . . . . . . . . . . . . . . . .  23
  91.          4.5 Final Sum of Squared Deviations . . . . . . . . . . . . .  23
  92.          4.6 Average and Maximum Deviation . . . . . . . . . . . . . .  23
  93.          4.7 Proportion of Variance Explained  . . . . . . . . . . . .  23
  94.          4.8 Adjusted Coefficient of Multiple Determination  . . . . .  24
  95.          4.9 Durbin-Watson Statistic . . . . . . . . . . . . . . . . .  24
  96.  
  97.  
  98.                                         i
  99.  
  100.        Contents                                                         ii
  101.  
  102.  
  103.          4.10 Analysis of Variance Table . . . . . . . . . . . . . . .  25
  104.  
  105.        5. Theory of Operation  . . . . . . . . . . . . . . . . . . . .  26
  106.          5.1 Minimization Algorithm  . . . . . . . . . . . . . . . . .  26
  107.          5.2 Convergence Criterion . . . . . . . . . . . . . . . . . .  26
  108.  
  109.        6. Hints for Nonlin Use . . . . . . . . . . . . . . . . . . . .  28
  110.          6.1 Convergence Failures  . . . . . . . . . . . . . . . . . .  28
  111.          6.2 Singular Matrix Problems  . . . . . . . . . . . . . . . .  29
  112.          6.3 Performance Issues  . . . . . . . . . . . . . . . . . . .  29
  113.          6.4 Program Limits  . . . . . . . . . . . . . . . . . . . . .  30
  114.  
  115.        7. Example Analyses . . . . . . . . . . . . . . . . . . . . . .  31
  116.  
  117.        8. Special Applications . . . . . . . . . . . . . . . . . . . .  34
  118.          8.1 Omitted Dependent Variable  . . . . . . . . . . . . . . .  34
  119.          8.2 Root Finding and Expression Minimization  . . . . . . . .  35
  120.            8.2.1 Function Minimization Examples  . . . . . . . . . . .  37
  121.  
  122.        9. Acknowledgement and Use of Nonlin  . . . . . . . . . . . . .  38
  123.          9.1 Acknowledgement . . . . . . . . . . . . . . . . . . . . .  38
  124.          9.2 Use and Distribution of Nonlin  . . . . . . . . . . . . .  38
  125.          9.3 Association of Shareware Professionals  . . . . . . . . .  39
  126.          9.4 Copyright Notice  . . . . . . . . . . . . . . . . . . . .  39
  127.          9.5 Disclaimer  . . . . . . . . . . . . . . . . . . . . . . .  39
  128.  
  129.        10. Other Software  . . . . . . . . . . . . . . . . . . . . . .  40
  130.          10.1 Mathplot -- Mathematical Function Plotting Program . . .  40
  131.          10.2 TSX-32 -- Multi-User Operating System  . . . . . . . . .  40
  132.          10.3 SIMSTAT -- Interactive Statistics Program  . . . . . . .  41
  133.  
  134.        11. Software Order Form . . . . . . . . . . . . . . . . . . . .  42
  135.  
  136.        Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  43
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.                                     Chapter 1
  144.  
  145.                                   Introduction
  146.  
  147.  
  148.  
  149.  
  150.        1.1 Introduction to Regression Analysis
  151.  
  152.        The  goal  of  regression  analysis  is  to determine the values of
  153.        parameters for a function that cause the function  to  best  fit  a
  154.        set  of  data observations that you provide.  In linear regression,
  155.        the function is a linear (straight line)  equation.   For  example,
  156.        if  we  assume  the  value of an automobile decreases by a constant
  157.        amount each year after its purchase, and for each mile driven,  the
  158.        following  linear  function  would predict its value (the dependent
  159.        variable) as a function of the two independent variables which  are
  160.        age and miles:
  161.  
  162.             value = price + depage*age + depmiles*miles
  163.  
  164.        where  'value',  the  dependent  variable, is the value of the car,
  165.        'age' is the age of the car, and 'miles' is  the  number  of  miles
  166.        that the car has been driven.
  167.  
  168.        The  regression  analysis  performed  by  Nonlin will determine the
  169.        best values of the three parameters, 'price', the  estimated  value
  170.        when  age  is  0  (i.e.,  when  the  car  was  new),  'depage', the
  171.        depreciation that  takes  place  each  year,  and  'depmiles',  the
  172.        depreciation  for  each  mile  driven.   The values of 'depage' and
  173.        'depmiles' will be negative because the car loses value as age  and
  174.        miles increase.
  175.  
  176.        In  a  problem  such  as  this  car  depreciation example, you must
  177.        provide a data file containing the  values  of  the  dependent  and
  178.        independent  variables  for a set of observations.  In this example
  179.        each observation record would contain three  numbers:  value,  age,
  180.        and  miles,  collected  from  used  car ads for the same model car.
  181.        The more observations you provide, the more accurate  will  be  the
  182.        estimate  of  the  parameters.  The Nonlin commands to perform this
  183.        regression are shown below:
  184.  
  185.             VARIABLES VALUE,AGE,MILES
  186.             PARAMETERS PRICE,DEPAGE,DEPMILES
  187.             FUNCTION VALUE = PRICE + DEPAGE*AGE + DEPMILES*MILES
  188.             DATA
  189.             (data values go here)
  190.  
  191.        Once the values of the parameters are  determined  by  Nonlin,  you
  192.        can  use the formula to predict the value of a car based on its age
  193.  
  194.  
  195.                                         1
  196.  
  197.        Chapter 1. Introduction                                           2
  198.  
  199.  
  200.        and miles driven.  For example,  if  Nonlin  computed  a  value  of
  201.        16000  for  price,  -1000  for depage, and -0.15 for depmiles, then
  202.        the function
  203.  
  204.             value = 16000 - 1000*age - 0.15*miles
  205.  
  206.        could be used to estimate the value of a car with a known  age  and
  207.        number of miles.
  208.  
  209.        If  a perfect fit existed between the function and the actual data,
  210.        the actual value of each car in your data file would exactly  equal
  211.        the  predicted  value.   Typically,  however, this is not the case,
  212.        and the difference  between  the  actual  value  of  the  dependent
  213.        variable  and  its  predicted value for a particular observation is
  214.        the error of the estimate which is  known  as  the  "deviation"  or
  215.        "residual".   The  goal  of regression analysis is to determine the
  216.        values of the parameters which minimize  the  sum  of  the  squared
  217.        residual  values  for  the set of observations.  This is known as a
  218.        "least squares" regression fit.
  219.  
  220.        1.2 Introduction to Nonlin
  221.  
  222.        Nonlin is a very powerful regression analysis  program.   Using  it
  223.        you  can  perform  multivariate,  linear,  polynomial, exponential,
  224.        logistic, and general nonlinear regression.   What  this  means  is
  225.        that  you  specify  the  form  of  the function to be fitted to the
  226.        data,  and  the  function  may  include  nonlinear  terms  such  as
  227.        variables  raised  to  powers  and  library  functions such as log,
  228.        exponential, sine, etc.  Nonlin uses a state-of-the-art  regression
  229.        algorithm  that  works  as well, or better, than any you are likely
  230.        to find in commercial statistical packages.
  231.  
  232.        As  an  example   of   nonlinear   regression,   consider   another
  233.        depreciation  problem.   The value of a used airplane decreases for
  234.        each year of its age.  Assuming the value of a plane falls  by  the
  235.        same amount each year, a linear function relating value to age is:
  236.  
  237.             Value = p0 + p1*Age
  238.  
  239.        Where  'p0'  and  'p1'  are  the  parameters whose values are to be
  240.        determined.  However, it is a well  known  fact  that  planes  (and
  241.        automobiles)  lose  more  value the first year than the second, and
  242.        more the second than the third, etc.   This  means  that  a  linear
  243.        (straight  line)  function  cannot accurately model this situation.
  244.        A better, nonlinear, function is:
  245.  
  246.             Value = p0 + p1*exp(-p2*Age)
  247.  
  248.        Where the 'exp' function is the value of  e  (2.7182818...)  raised
  249.        to   a  power.   This  type  of  function  is  known  as  "negative
  250.        exponential" and is appropriate for modeling a value whose rate  of
  251.        decrease  is  proportional  to the difference between the value and
  252.        some base value.  The  F33YEAR.NLR  example  command  file  fits  a
  253.        linear  function  to  the  value of used airplanes.  The F33EXP.NLR
  254.        example fits a negative exponential  function  to  the  same  data.
  255.  
  256.        Chapter 1. Introduction                                           3
  257.  
  258.  
  259.        Run  both  examples  and compare the fitted functions.  See F33.NLR
  260.        for an example of a multiple  regression  using  three  independent
  261.        variables.
  262.  
  263.        Much  of the convenience of Nonlin comes from the fact that you can
  264.        enter complicated  functions  using  ordinary  algebraic  notation.
  265.        Examples of functions that can be handled with Nonlin include:
  266.  
  267.             Linear:        Y = p0 + p1*X
  268.  
  269.             Quadratic:     Y = p0 + p1*X + p2*X^2
  270.  
  271.             Multivariate:  Y = p0 + p1*X + p2*Z + p3*X*Z
  272.  
  273.             Exponential:   Y = p0 + p1*exp(X)
  274.  
  275.             Periodic:      Y = p0 + p1*sin(p2*X)
  276.  
  277.             Misc:          Y = p0 + p1*Y + p2*exp(Y) + p3*sin(Z)
  278.  
  279.        In  other words, the function is a general expression involving one
  280.        dependent variable (on the left of the equal  sign),  one  or  more
  281.        independent  variables, and one or more parameters whose values are
  282.        to be estimated.
  283.  
  284.        Because  of  its  generality,  Nonlin  can  perform  all   of   the
  285.        regressions  handled  by ordinary linear or multivariate regression
  286.        programs as well as nonlinear regression.   However,  in  order  to
  287.        handle  nonlinear  functions,  Nonlin  uses  an  iterative function
  288.        optimization algorithm which  is  slower  than  the  simple  linear
  289.        regression  algorithm and has the potential for not converging to a
  290.        solution.
  291.  
  292.        1.3 Installing Nonlin
  293.  
  294.        The Nonlin system consists of the following files:
  295.  
  296.               NONLIN.EXE -- The executable program.
  297.               NONLIN.DOC -- Documentation file.
  298.               NONLIN.FON -- Font file used if you request a plot.
  299.               NONLIN.LJF -- LaserJet font file (registered version only).
  300.                    *.NLR -- Example command files.
  301.             REGISTER.DOC -- Form used to register your use of Nonlin.
  302.  
  303.        To install Nonlin, copy  the  files  into  the  directory  of  your
  304.        choice.   The  registered  version  of Nonlin includes a file named
  305.        NONLIN.LJF with the fonts needed for printing plots on HP  LaserJet
  306.        printers.   If  you do not plan to generated hard copy output for a
  307.        LaserJet printer, you may  delete  the  NONLIN.LJF  file.   If  the
  308.        NONLIN.FON  and NONLIN.LJF files are not in your current directory,
  309.        you  must  place  a  command  of  the  following   form   in   your
  310.        AUTOEXEC.BAT file to tell Nonlin where to look for its font files:
  311.  
  312.             SET NONLIN=directory
  313.  
  314.        Chapter 1. Introduction                                           4
  315.  
  316.  
  317.        Where  "directory"  is  the  name of the device and directory where
  318.        the files are located.  For example, if the files are located in  a
  319.        directory  named  NONLIN on the C disk, the following command could
  320.        be used:
  321.  
  322.             SET NONLIN=C:\NONLIN
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.                                     Chapter 2
  330.  
  331.                                   Using Nonlin
  332.  
  333.  
  334.  
  335.  
  336.        Once Nonlin has been installed, it  can  be  started  using  a  DOS
  337.        command of the form:
  338.  
  339.             NONLIN command_file [listing_file]
  340.  
  341.        where  "command_file"  is  the  name  of  a  file containing Nonlin
  342.        commands that control  the  analysis.   The  sections  that  follow
  343.        describe  these  commands.   If  you  specify  a  command file name
  344.        without an extension, ".NLR" is used as the default extension.   If
  345.        you  omit  the  command  file  name,  Nonlin  prints  a list of its
  346.        commands.
  347.  
  348.        A "listing_file" parameter may be specified on  the  command  line.
  349.        If  you specify a file name, the output (results) of the regression
  350.        analysis are written to this file.  If no file name  is  specified,
  351.        the  output  is  written  to  a  file  with  the  same  name as the
  352.        command_file but with the  extension  ".LST".   If  you  specify  a
  353.        listing  file  name without an extension, ".LST" is provided as the
  354.        default extension.  Specify NUL for the listing_file if you do  not
  355.        want to generate an output file.
  356.  
  357.        For  example, to process a command file named LINEAR.NLR, directing
  358.        output to a file named LINEAR.LST, use the following command:
  359.  
  360.             NONLIN LINEAR
  361.  
  362.        To do the same analysis, directing  the  output  to  a  file  named
  363.        MODEL1.LST, use the following command:
  364.  
  365.             NONLIN LINEAR MODEL1
  366.  
  367.        Normally  Nonlin commands and computed results are displayed on the
  368.        screen and written to the listing file; however,  if  you  place  a
  369.        NOECHO   command  in  your  command  file  the  screen  display  is
  370.        suppressed but the output is still written to the listing file.
  371.  
  372.        At this point, I suggest you pause in your reading and try  running
  373.        a  Nonlin  example to get a feel for how it works.  Several example
  374.        files  with  the   extension   ".NLR"   are   provided   with   the
  375.        distribution.   LINEAR.NLR  is a good one to start with followed by
  376.        AIDS.NLR.  If  you  do  not  have  a  graphics  monitor,  edit  the
  377.        LINEAR.NLR  command  file  (and other example files) and remove the
  378.        PLOT command.
  379.  
  380.  
  381.                                         5
  382.  
  383.        Chapter 2. Using Nonlin                                           6
  384.  
  385.  
  386.        2.1 Function Specification
  387.  
  388.        Much of the power of Nonlin comes from its ability to estimate  the
  389.        value  of  parameters  that  are part of complicated functions that
  390.        you enter in ordinary algebraic form.  This  section  explains  the
  391.        arithmetic  operators  and  built-in  functions  that  are  used to
  392.        specify a function.
  393.  
  394.        2.1.1 Arithmetic Operators
  395.  
  396.        The following arithmetic operators may be used in expressions:
  397.  
  398.             +        addition
  399.             -        subtraction or unary minus
  400.             *        multiplication
  401.             /        division
  402.             ** or ^  exponentiation
  403.  
  404.        Exponentiation   has   the   highest   precedence,   followed    by
  405.        multiplication  and  division,  and  then addition and subtraction.
  406.        Parentheses may be used to group terms.
  407.  
  408.        2.1.2 Numeric Constants
  409.  
  410.        Numeric constants may be written in their natural form (1, 0,  1.5,
  411.        .0003,  etc.) or in exponential form, n.nnnEppp, where n.nnn is the
  412.        base value and ppp is the  power  of  ten  by  which  the  base  is
  413.        multiplied.   For example, the number 1.5E4 is equivalent to 15000.
  414.        All numbers are treated as "floating point" values,  regardless  of
  415.        whether  a decimal point is specified or not.  As a convenience for
  416.        entering time values, if a value contains one or more  colons,  the
  417.        portion  to  the  left  of  the  colon  is  multiplied  by 60.  For
  418.        example, 1:00 is equivalent to 60; 1:00:00 is equivalent to 3600.
  419.  
  420.        2.1.3 Symbolic Constants
  421.  
  422.        You can use the CONSTANT command to associate symbolic  names  with
  423.        constant  numeric  values.   When  you use the symbolic name in the
  424.        function the numeric value is substituted for the symbolic name.
  425.  
  426.        2.1.4 Built-in Constants
  427.  
  428.        There are two built-in numeric  constants  that  may  be  specified
  429.        using  symbolic names.  The symbolic name "PI" is equivalent to the
  430.        value of pi, 3.14159...  Similarly, the symbolic  constant  "E"  is
  431.        equivalent  to the base of natural logarithms, e, 2.7182818...  You
  432.        may write PI and E using either upper or lower case.
  433.  
  434.        Chapter 2. Using Nonlin                                           7
  435.  
  436.  
  437.        2.1.5 Built-in Functions
  438.  
  439.        The following functions are built into Nonlin and may  be  used  in
  440.        expressions:
  441.  
  442.        ABS(x) -- Absolute value of x.
  443.  
  444.        ACOS(x) -- Arc cosine of x.  Angles are measured in radians.
  445.  
  446.        ASIN(x) -- Arc sine of x.  Angles are measured in radians.
  447.  
  448.        ATAN(x) -- Arc tangent of x.  Angles are measured in radians.
  449.  
  450.        BETAI(x,a,b)  -- Incomplete beta function: Ix(a,b).  The incomplete
  451.            beta function can be used to compute a variety  of  statistical
  452.            functions.   For  example,  the probability of Student's t with
  453.            'df'   degrees   of    freedom    can    be    computed    with
  454.            BETAI(df/(df+t^2),.5*df,.5).    The   probability   of   the  F
  455.            statistic with df1 and df2 degrees of freedom can  be  computed
  456.            with 2*BETAI(df2/(df2+df1*f),.5*df2,.5*df1).
  457.  
  458.        COS(x) -- Cosine of x.  Angles are measured in radians.
  459.  
  460.        COSH(x) -- Hyperbolic cosine of x.
  461.  
  462.        COT(x) -- Cotangent of x.  (COT(x) = 1/TAN(x)).  Angle in radians.
  463.  
  464.        CSC(X) -- Cosecant of x.  (CSC(x) = 1/SIN(x)).  Angle in radians.
  465.  
  466.        CTOP(angle)  --  Convert  an angle in the compass coordinate system
  467.            to a polar coordinate angle.  The polar coordinate  system  has
  468.            the  origin of an angle along the positive X axis and the angle
  469.            increases  in  a  counter-clockwise  direction.   The   compass
  470.            coordinate  system has the positive Y axis as the origin (i.e.,
  471.            north) and the angle increases in a clockwise  direction.   The
  472.            angle  must  be specified in radians.  The returned value is in
  473.            the range 0 to 2*pi.  The PTOC function  performs  the  reverse
  474.            transformation.
  475.  
  476.        DEG(x)  --  Converts  an  angle,  x,  measured  in  radians  to the
  477.            equivalent number of degrees.
  478.  
  479.        EI1(alpha,phi) -- Elliptic integral of the  first  kind.   Computes
  480.            the   integral   from   0   to  phi  radians  of  the  function
  481.            d.phi/sqrt(1-k**2*sin(phi)**2), where k  =  sin(alpha).   alpha
  482.            and phi must be in the range 0 to pi/2.
  483.  
  484.        EI2(alpha,phi)  --  Elliptic integral of the second kind.  Computes
  485.            the  integral  from  0  to  phi   radians   of   the   function
  486.            sqrt(1-k**2*sin(phi)**2)*d.phi,  where  k  = sin(alpha).  alpha
  487.            and phi must be in the range 0 to pi/2.
  488.  
  489.        EIC1(alpha) --  Complete  elliptic  integral  of  the  first  kind.
  490.            Computes  the  integral  from 0 to pi/2 radians of the function
  491.  
  492.        Chapter 2. Using Nonlin                                           8
  493.  
  494.  
  495.            d.phi/sqrt(1-k**2*sin(phi)**2), where k  =  sin(alpha).   alpha
  496.            must be in the range 0 to (less than) pi/2.
  497.  
  498.        EIC2(alpha)  --  Complete  elliptic  integral  of  the second kind.
  499.            Computes the integral from 0 to pi/2 radians  of  the  function
  500.            sqrt(1-k**2*sin(phi)**2)*d.phi,  where  k  = sin(alpha).  alpha
  501.            must be in the range 0 to pi/2.
  502.  
  503.        ERF(x) -- Standard error function of x.
  504.  
  505.        EXP(x) -- e (base of natural logarithms) raised to the x power.
  506.  
  507.        FAC(x) -- x factorial (x!).  Note, the  FAC  function  is  computed
  508.            using  the  GAMMA  function  (FAC(x)=GAMMA(x+1)) so non-integer
  509.            argument values may be computed.
  510.  
  511.        GAMMA(x) -- Gamma function.  Note, GAMMA(x+1) = x!  (x factorial).
  512.  
  513.        GAMMAI(x)  --   Reciprocal   of   GAMMA   function   (GAMMAI(x)   =
  514.            1/GAMMA(x)).
  515.  
  516.        GAMMALN(x) -- Log (base e) of the GAMMA function.
  517.  
  518.        HAV(x)  --  Haversine  of  x.   (HAV(x)  = (1-COS(x))/2).  Angle in
  519.            radians.
  520.  
  521.        J0(x) -- Bessel function of the first kind, order zero.
  522.  
  523.        J1(x) -- Bessel function of the first kind, order one.
  524.  
  525.        JN(n,x) -- Bessel function of the first kind, order n.
  526.  
  527.        LOG(x) -- Natural logarithm of x.
  528.  
  529.        LOG10(x) -- Base 10 logarithm of x.
  530.  
  531.        LOG2(x) -- Base 2 logarithm of x.
  532.  
  533.        MAX(x1,x2) -- Maximum value of x1 or x2.
  534.  
  535.        MIN(x1,x2) -- Minimum value of x1 or x2.
  536.  
  537.        NORMAL(x) -- Normal probability distribution of x.  X is  in  units
  538.            of  standard  deviations  from  the  mean.   See  also  the NPD
  539.            function.  NORMAL(x) = NPD(x,0,1);
  540.  
  541.        NPD(x,mean,std)  --  Normal  probability  distribution  of  x  with
  542.            specified  mean  and  standard  deviation.   X  is  in units of
  543.            standard deviations from the mean.
  544.  
  545.        PAREA(x) -- Area under the normal  probability  distribution  curve
  546.            from  -infinity  to  x.  (i.e., integral from -infinity to x of
  547.            NORMAL(x)).
  548.  
  549.        Chapter 2. Using Nonlin                                           9
  550.  
  551.  
  552.        PTOC(angle) -- Convert an angle in the polar coordinate  system  to
  553.            a  compass  coordinate  angle.  The polar coordinate system has
  554.            the origin of an angle along the positive X axis and the  angle
  555.            increases   in  a  counter-clockwise  direction.   The  compass
  556.            coordinate system has the positive Y axis as the origin  (i.e.,
  557.            north)  and  the angle increases in a clockwise direction.  The
  558.            angle must be specified in radians.  The returned value  is  in
  559.            the  range  0  to 2*pi.  The CTOP function performs the reverse
  560.            transformation.
  561.  
  562.        PTORX(angle,distance) -- Convert a position  in  polar  coordinates
  563.            to  the  corresponding  rectangular  coordinate.  This function
  564.            returns the X coordinate of the position; use PTORY  to  obtain
  565.            the  Y  coordinate.   Note:  polar coordinates are specified in
  566.            radians with the positive X  axis  being  the  origin  for  the
  567.            angle  and  with  the angle increasing in the counter-clockwise
  568.            direction.
  569.  
  570.        PTORY(angle,distance) -- Convert a position  in  polar  coordinates
  571.            to  the  corresponding  rectangular  coordinate.  This function
  572.            returns the Y coordinate of the position; use PTORX  to  obtain
  573.            the  X  coordinate.   Note:  polar coordinates are specified in
  574.            radians with the positive X  axis  being  the  origin  for  the
  575.            angle  and  with  the angle increasing in the counter-clockwise
  576.            direction.
  577.  
  578.        PULSE(a,x,b) -- Pulse function.  If the value of x is less  than  a
  579.            or  greater  than  b,  the value of the function is 0.  If x is
  580.            greater than or equal to a and less than or  equal  to  b,  the
  581.            value  of  the  function is 1.  In other words, it is 1 for the
  582.            domain (a,b) and zero elsewhere.  If you need a  function  that
  583.            is   zero  in  the  domain  (a,b)  and  1  elsewhere,  use  the
  584.            expression (1-PULSE(a,x,b)).
  585.  
  586.        RAD(x) -- Converts an angle measured in degrees to  the  equivalent
  587.            number of radians.
  588.  
  589.        RTOPA(x,y)  --  Convert  a  rectangular  coordinate  (x,y)  to  the
  590.            corresponding   polar   coordinate   (angle,distance).     This
  591.            function  returns  the  angle,  use  RTOPD  to get the distance
  592.            coordinate.  The returned value of the function is in units  of
  593.            radians   and   is  in  the  range  0  to  2*pi.   Note:  polar
  594.            coordinates are specified in radians with the positive  X  axis
  595.            being  the  origin  for the angle and with the angle increasing
  596.            in the counter-clockwise direction.
  597.  
  598.        RTOPD(x,y)   --   Convert   a   rectangular   coordinate   to   the
  599.            corresponding  polar  coordinate.   This  function  returns the
  600.            distance from the origin, use RTOPA to get  the  angle.   Note:
  601.            polar  coordinates are specified in radians with the positive X
  602.            axis being  the  origin  for  the  angle  and  with  the  angle
  603.            increasing in the counter-clockwise direction.
  604.  
  605.        SEC(x) -- Secant of x.  (SEC(x) = 1/COS(x)).  Angle in radians.
  606.  
  607.        Chapter 2. Using Nonlin                                          10
  608.  
  609.  
  610.        SEL(a1,a2,v1,v2)  --  If  a1  is less than a2 then the value of the
  611.            function is v1.  If a1 is greater than or  equal  to  a2,  then
  612.            the value of the function is v2.
  613.  
  614.        SIN(x) -- Sine of x.  Angles are measured in radians.
  615.  
  616.        SINH(x) -- Hyperbolic sine of x.
  617.  
  618.        SQRT(x) -- Square root of x.
  619.  
  620.        STEP(a,x)  -- Step function.  If x is less than a, the value of the
  621.            function is 0.  If x is greater than or equal to a,  the  value
  622.            of  the function is 1.  If you need a function which is 1 up to
  623.            a  certain  value  and  then  0  beyond  that  value,  use  the
  624.            expression  STEP(x,a).   See  PIECE.NLR  for an example of this
  625.            function.
  626.  
  627.        T(n,x) -- Chebyshev polynomial of order n.
  628.  
  629.        TAN(x) -- Tangent of x.  Angles are measured in radians.
  630.  
  631.        TANH(x) -- Hyperbolic tangent of x.
  632.  
  633.        Y0(x) -- Bessel function of the second kind, order zero.
  634.  
  635.        Y1(x) -- Bessel function of the second kind, order one.
  636.  
  637.        YN(n,x) -- Bessel function of the second kind, order n.
  638.  
  639.        2.2 Nonlin Command Files
  640.  
  641.        The commands described in this section  are  placed  in  a  command
  642.        file.   When  you start Nonlin, you specify the name of the command
  643.        file as a parameter on the  command  line.   For  example,  if  the
  644.        command  file  name  is  CAR.NLR, the following command would cause
  645.        Nonlin to execute the commands in the command file:
  646.  
  647.             NONLIN CAR.NLR
  648.  
  649.        If you do not specify a file name extension for the  command  file,
  650.        ".NLR"  is  used by default.  The output of the regression for this
  651.        example would be written to a file named  CAR.LST.   Command  files
  652.        can  be created using a text editor such as EDIT-32, EDLIN, the DOS
  653.        EDIT program, or  any  other  editor  or  word  processor  that  is
  654.        capable of creating an ascii text file without formatting codes.
  655.  
  656.        Comments  may  be  placed in command files by preceding the comment
  657.        with an exclamation point.  Entire lines may be used  for  comments
  658.        and comments can be placed at the end of commands.
  659.  
  660.        Command  lines can be continued by placing a semicolon character as
  661.        the last non-blank character on the line (a comment may follow  the
  662.        semicolon)  and  then  continuing  the  command  on  the  following
  663.        line(s).
  664.  
  665.        Chapter 2. Using Nonlin                                          11
  666.  
  667.  
  668.        Every command file must contain the following commands:  VARIABLES,
  669.        PARAMETERS,  FUNCTION, and DATA.  The DATA statement introduces the
  670.        data for the analysis and must be the  last  command  in  the  file
  671.        (data  records  may  follow  it).  Other, optional, commands may be
  672.        interspersed in the command file.  The following is an  example  of
  673.        a complete command file:
  674.  
  675.             VARIABLES  VALUE,AGE,MILES
  676.             PARAMETERS BASE,DEPAGE,DEPMILES
  677.             FUNCTION VALUE = BASE + DEPAGE*AGE + DEPMILES*MILES
  678.             DATA
  679.             (data records follow)
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.                                     Chapter 3
  687.  
  688.                                  Nonlin Commands
  689.  
  690.  
  691.  
  692.  
  693.        The  following  is  a list of the valid Nonlin commands that can be
  694.        placed  in  a  Nonlin  command  file.   Command  keywords  may   be
  695.        abbreviated  to  the  first  three  letters  except  for  CONSTANT,
  696.        CONSTRAIN,  and  CONFIDENCE  which  require  six  letters.   Nonlin
  697.        commands are not case sensitive.
  698.  
  699.        3.1 TITLE
  700.  
  701.        TITLE  string  (optional) -- Specifies a title line that is printed
  702.        with the results of the analysis.
  703.  
  704.        3.2 VARIABLES
  705.  
  706.        VARIABLES var1,var2,...  (required) -- Specifies the names  of  the
  707.        variables  that  will  be  used  in  the  function.   The dependent
  708.        variable and the independent  variables  must  be  specified.   The
  709.        order  of  the  variable  names  must  match  the order of the data
  710.        values on each observation record (the dependent variable may  come
  711.        before  or  after  the independent variables).  You may define more
  712.        variables than you actually use in the function  specification.   A
  713.        maximum  of  20  variables  may  be  specified.   The  length  of a
  714.        variable  name  is  limited  to  10  characters.   Capitalize   the
  715.        variable names as you want them displayed in the results.
  716.  
  717.        You  may  specify  all  of  the  variables on a single command line
  718.        (which may  be  continued),  or  you  may  use  multiple  VARIABLES
  719.        commands.   If  you  use multiple commands, the order in which they
  720.        appear in the command file must match the  order  of  the  variable
  721.        values  on  each  observation  record.   The VARIABLES command must
  722.        precede the FUNCTION command.  See F33.NLR  for  an  example  of  a
  723.        multiple regression using three independent variables.
  724.  
  725.        3.3 PARAMETERS
  726.  
  727.        PARAMETERS  param1[=initial1],param2[=initial2],...   (required) --
  728.        Specifies the names of  the  parameters  whose  values  are  to  be
  729.        determined  by  Nonlin.   Nonlin  is  capable  of handling up to 25
  730.        parameters.  The parameter names may not exceed  10  characters  in
  731.        length.   Do  not  specify  any parameters that are not used in the
  732.        function.   The  PARAMETERS  command  must  precede  the   FUNCTION
  733.        command.
  734.  
  735.  
  736.  
  737.  
  738.                                        12
  739.  
  740.        Chapter 3. Nonlin Commands                                       13
  741.  
  742.  
  743.        Optionally,  an  initial  estimate  of  the  parameter value may be
  744.        specified by following the parameter name with an  equal  sign  and
  745.        the  value.   If  no  value  is  specified,  1  is used by default.
  746.        Specifying an initial value that is near the actual  value  usually
  747.        speeds   up   the   operation  of  Nonlin  and  may  enable  it  to
  748.        successfully converge to  a  solution.   If  Nonlin  is  unable  to
  749.        converge  to  a  solution, try specifying different starting values
  750.        for the parameters.  Try to specify a value that at least  has  the
  751.        correct sign as the expected final value.
  752.  
  753.        The  CONSTRAIN command (see page 14) can be used to limit the range
  754.        of values for parameters.  The SWEEP command (see page 14)  can  be
  755.        used  to  perform the regression analysis with a range of parameter
  756.        initial values.  The CONSTANT command  can  be  used  to  define  a
  757.        parameter with a fixed value.
  758.  
  759.        3.4 CONFIDENCE
  760.  
  761.        CONFIDENCE  [percent]  (optional)  --  Specifies  that a confidence
  762.        interval is to  be  printed  for  each  estimated  parameter.   The
  763.        purpose  of  regression  analysis is to determine the best estimate
  764.        of  parameter  values.    However,   as   with   most   statistical
  765.        calculations,  the  values  determined  are  estimates  of the true
  766.        values.  The CONFIDENCE command causes  Nonlin  to  print  a  table
  767.        showing  the  range  of  possible values for each parameter given a
  768.        specified confidence value.  The "percent" parameter specifies  the
  769.        probability  that  that the actual value of the parameter is within
  770.        the confidence interval to be computed.  For example, the command
  771.  
  772.             CONFIDENCE 95
  773.  
  774.        specifies that the confidence interval(s) are to be  computed  such
  775.        that  there  is  a 95 percent probability that the actual values of
  776.        the parameters are within the intervals  (or  that  there  is  a  5
  777.        percent  chance  that  the  parameters  are outside the intervals).
  778.        The "percent" parameter may  range  from  50  to  99.999.   If  the
  779.        CONFIDENCE  command  is used without specifying a percent value, 90
  780.        is used by default.
  781.  
  782.        3.5 CONSTANT
  783.  
  784.        CONSTANT parameter=value (optional) --  Specifies  the  name  of  a
  785.        symbolic  constant  and  associates  a numeric value.  You may then
  786.        use the  symbolic  name  in  the  function  and  the  corresponding
  787.        constant  numeric  value  will be substituted.  This is useful when
  788.        you are trying out different models and want to easily be  able  to
  789.        change  a  constant value for each run.  The CONSTANT commands must
  790.        precede the FUNCTION command.  The following is  an  example  of  a
  791.        symbolic  constant  named "Roomtemp" that causes the value 73 to be
  792.        substituted in the function:
  793.  
  794.        Chapter 3. Nonlin Commands                                       14
  795.  
  796.  
  797.             Variable Time            ! Cooling time in seconds
  798.             Variable Temp            ! Temperature of object
  799.             Constant Roomtemp = 73        ! Ambient temperature
  800.             Parameter InitTemp        ! Initial temperature
  801.             Parameter Coolrate        ! Cooling rate factor
  802.             Function Temp = Roomtemp + InitTemp * exp(-Coolrate * Time)
  803.  
  804.        3.6 CONSTRAIN
  805.  
  806.        CONSTRAIN parameter=lowvalue,highvalue (optional)  --  Specifies  a
  807.        lower  and  upper  limit on the range of a parameter value.  During
  808.        the solution process, Nonlin  may  allow  a  parameter's  value  to
  809.        temporarily  move  in  a direction away from its final value.  With
  810.        some functions it may be necessary  to  constrain  the  parameter's
  811.        value  so that it does not go negative (e.g., if the function takes
  812.        the square root of the parameter), or zero (if the parameter is  in
  813.        a  denominator).  If a parameter is tightly constrained, Nonlin may
  814.        report "singular convergence" because it is unable to  converge  to
  815.        an  optimum  value  of the parameter; however, the estimated values
  816.        of other parameters may be useful.
  817.  
  818.        Only a single parameter and its associated limits may be  specified
  819.        on  each  CONSTRAIN  command,  but  you  may use multiple CONSTRAIN
  820.        commands.   The  PARAMETERS  command  must  precede  the  CONSTRAIN
  821.        command.   Use  the  CONSTANT  command  if  you  wish  to  define a
  822.        parameter with a fixed value.
  823.  
  824.        The  parameter  value  is  allowed  to  range  from  'lowvalue'  to
  825.        'highvalue'.   If  you want to prevent a parameter value from going
  826.        to zero, you must specify a value greater than  zero  for  the  low
  827.        value  (specifying  zero would allow it to reach, but not go below,
  828.        zero).  For example, the following command constrains the value  of
  829.        'age' to be greater than zero and less than or equal to 100:
  830.  
  831.             CONSTRAIN AGE = .0001,100
  832.  
  833.        See  the  COOLING.NLR, F33EXP.NLR, and POWER.NLR files for examples
  834.        of the CONSTRAIN command.
  835.  
  836.        3.7 COVARIANCE
  837.  
  838.        COVARIANCE (optional) -- Causes the variance-covariance matrix  for
  839.        the parameters to be printed.
  840.  
  841.        3.8 SWEEP
  842.  
  843.        SWEEP parameter=lowvalue,highvalue,stepsize (optional) --
  844.        Specifies   that   the  regression  analysis  is  to  be  performed
  845.        repeatedly with a set of starting values for  the  parameter.   The
  846.        first   analysis   is  performed  with  the  parameter  having  the
  847.        'lowvalue';  the  value  of  'stepsize'  is  then  added   to   the
  848.        parameter's  initial  value  and  the  analysis is performed again.
  849.        The process is repeated until the value of  the  parameter  reaches
  850.        'highvalue'.
  851.  
  852.        Chapter 3. Nonlin Commands                                       15
  853.  
  854.  
  855.        Each  time  the analysis is performed the value of the residual sum
  856.        of  squares  is  compared  with  the  best  previous  result.   The
  857.        estimated  values of the parameters for the best starting value are
  858.        saved and used for the final analysis and report.
  859.  
  860.        Only one parameter may be specified on each SWEEP command, but  you
  861.        may  have  as  many  SWEEP  commands  as there are parameters.  The
  862.        number of regression  analyses  performed  will  be  equal  to  the
  863.        product of the number of parameter values for each SWEEP command.
  864.  
  865.        The  SWEEP  command  is  useful  when  you  are  trying  to  fit  a
  866.        complicated function that may have  "local  minimum"  values  other
  867.        than  the  "global  minimum".   Periodic functions (sin, cos, etc.)
  868.        are especially troublesome.
  869.  
  870.        See the SINE.NLR command file for an example of the SWEEP command.
  871.  
  872.        3.9 FUNCTION
  873.  
  874.        FUNCTION depvar = function (required) -- Specifies the form of  the
  875.        function  whose  parameters  are  to  be determined.  The dependent
  876.        variable must be the only thing to the  left  of  the  equal  sign.
  877.        The  expression  to  the  right  of  the  equal  sign  may  contain
  878.        variables, parameters, constants, operators, and library  functions
  879.        such  as  sqrt,  sin,  exp,  etc.   The  VARIABLES  and  PARAMETERS
  880.        commands  must  have  appeared  in  the  command  file  before  the
  881.        FUNCTION  command,  and  all  variables  and parameters used in the
  882.        function must have been specified on those commands.  Some  example
  883.        FUNCTION commands are show below:
  884.  
  885.             FUNCTION  Y = P0 + P1*X
  886.  
  887.             FUNCTION  DISTANCE = .5 * ACCEL * TIME^2
  888.  
  889.             FUNCTION  VALUE = PRICE + YRDEP*AGE + MILEDEP*MILES
  890.  
  891.             FUNCTION  POPULATN = BASE * GROWRATE * EXP(TIME)
  892.  
  893.        3.10 TOLERANCE
  894.  
  895.        TOLERANCE   value   (optional,   default=1E-10)  --  Specifies  the
  896.        tolerance factor that is used to determine when the  algorithm  has
  897.        converged  to a solution.  Reducing the tolerance value may produce
  898.        a slightly more accurate result but will  increase  the  number  of
  899.        iterations  and  the  running time.  The tolerance value must be in
  900.        the range 1E-15 to 1E-1.
  901.  
  902.        3.11 ITERATIONS
  903.  
  904.        ITERATIONS value (optional, default=50) --  Specifies  the  maximum
  905.        number  of  iterations  that  should be attempted by the algorithm.
  906.        If the solution does not converge to the  limit  specified  by  the
  907.        TOLERANCE  command (or to the default tolerance) before the maximum
  908.        number of iterations is reached, the process  is  stopped  and  the
  909.  
  910.        Chapter 3. Nonlin Commands                                       16
  911.  
  912.  
  913.        results  are  printed.   Failure  to  converge before the specified
  914.        number of iterations could be caused by one of three things:
  915.  
  916.        1.  The maximum allowed number of  iterations  may  be  too  small.
  917.            Try using an ITERATIONS command with a larger value.
  918.  
  919.        2.  The  tolerance  factor  may  be  too  small.   Even  a properly
  920.            converging solution will eventually "level  off"  or  oscillate
  921.            around  a  good, but non-zero, sum of squares value.  Try using
  922.            the TOLERANCE command to increase the tolerance value.
  923.  
  924.        3.  The function may not be converging.  Try specifying better  (or
  925.            at  least  different) starting values for the parameters on the
  926.            PARAMETERS  command.   Consider  using  the  SWEEP  command  to
  927.            specify a range of parameter starting values.
  928.  
  929.        3.12 REGISTER
  930.  
  931.        REGISTER   (optional)   --  The  REGISTER  command  suppresses  the
  932.        copyright and registration message that  is  otherwise  written  to
  933.        the  listing  file  generated  by  the shareware version of Nonlin.
  934.        The REGISTER  command  performs  no  function  for  the  registered
  935.        version  of Nonlin.  The use of this command is a reminder that you
  936.        should register your use of Nonlin.  Note, if you  find  Nonlin  to
  937.        be  useful,  educational,  or  entertaining  you  are  expected  to
  938.        register your use so that the author can be justly compensated  and
  939.        that  development  of  the  program  can continue.  Use the form in
  940.        REGISTER.DOC (or on page 42) to register your use.
  941.  
  942.        3.13 OUTPUT
  943.  
  944.        OUTPUT [TO file] var1,var2,...  (optional) -- Specifies that  after
  945.        the  analysis  is  completed,  data  values  are  to  be printed or
  946.        written to a file.  If the "TO file"  portion  of  the  command  is
  947.        specified,  the  output  is written to the specified file.  If this
  948.        portion of the command is omitted, the output  values  are  printed
  949.        along  with  the  results.   If a file name is specified without an
  950.        extension, ".OUT" is used by default.
  951.  
  952.        The list of variable names determines which variables  are  written
  953.        to  the  file  and  the  order  in  which the values appear in each
  954.        output record.  Any variable previously  declared  on  a  VARIABLES
  955.        command  may  be  specified.   In  addition,  the following special
  956.        variable names may appear in the output list:
  957.  
  958.        $OBS  --  The  observation  record  number,  starting  at   1   and
  959.        increasing by 1.
  960.  
  961.        $PREDICTED  --  The  predicted value for the dependent variable for
  962.        the observation, given the  independent  variable  values  and  the
  963.        parameters as calculated by the analysis.
  964.  
  965.        $RESIDUAL  --  The  difference  between  the  actual  value  of the
  966.        dependent variable and its predicted value.
  967.  
  968.        Chapter 3. Nonlin Commands                                       17
  969.  
  970.  
  971.        Examples of OUTPUT commands are shown below:
  972.  
  973.             OUTPUT AGE,MILES,VALUE,$PREDICTED,$RESIDUAL
  974.             OUTPUT TO GROWTH.DAT $OBS,TIME,POPULATN,$PREDICTED
  975.  
  976.        3.14 POUTPUT
  977.  
  978.        POUTPUT file (optional)  --  The  POUTPUT  command  specifies  that
  979.        Nonlin  is to write the final estimated values of the parameters to
  980.        a file.  Each parameter value is written to a separate line of  the
  981.        file.   This  command  is  useful  to  create  a  file of estimated
  982.        parameter values to be fed into  another  analysis  program.   This
  983.        command  can  also  be used to determine the parameter estimates to
  984.        more significant digits  than  displayed  in  the  printed  listing
  985.        because  the  format  used by the POUTPUT command writes the values
  986.        with 18 significant digits.
  987.  
  988.        3.15 PLOT
  989.  
  990.        PLOT [options] (optional) --  Display  a  plot  of  the  calculated
  991.        function  and  the  data  observations.   The PLOT command can only
  992.        handle  a  single  independent   variable   (multiple   independent
  993.        variables  would  require  an n-dimensional surface plot); however,
  994.        there  is  no  restriction  on  the  number  of  parameters   being
  995.        estimated.    If  your  function  has  more  than  one  independent
  996.        variable you can use the RPLOT command (see Section 3.16).
  997.  
  998.        You must have a CGA, EGA, or VGA monitor to use the  PLOT  command,
  999.        and  the  NONLIN.FON  font file must be in the current directory or
  1000.        in a directory specified by the NONLIN  environment  variable.   In
  1001.        the  plot,  the  data values you provided are shown as blue X's and
  1002.        the function fitted to the data by  Nonlin  is  shown  as  a  solid
  1003.        green  line.   Press  Return to proceed with the analysis after you
  1004.        have finished looking at the plot.
  1005.  
  1006.        The following options may be specified on the PLOT command:
  1007.  
  1008.        GRID -- display grid lines to make it easier to estimate values.
  1009.  
  1010.        RESIDUAL -- draw vertical lines from each observed  data  point  to
  1011.            the  corresponding  point  on  the  calculated  function  line.
  1012.            These lines represent  the  "residual"  value  that  Nonlin  is
  1013.            attempting  to  minimize.   See  also  the  descriptions of the
  1014.            RPLOT and NPLOT commands on pages 18 and 19.
  1015.  
  1016.        ITERATION -- draw a plot  for  each  iteration  of  the  regression
  1017.            analysis.   Normally,  the plot is drawn after the analysis has
  1018.            converged to a solution; you may use the  ITERATION  option  to
  1019.            observe  the  function during each iteration of the analysis as
  1020.            it converges to fit the data.
  1021.  
  1022.        VALUES -- use in conjunction with the  ITERATION  option  to  cause
  1023.            the  current  parameter  values to be displayed before the plot
  1024.            for the current iteration.
  1025.  
  1026.        Chapter 3. Nonlin Commands                                       18
  1027.  
  1028.  
  1029.        PRINT -- print a copy of the plot on an HP LaserJet printer.   This
  1030.            option  is  only available in the registered version of Nonlin.
  1031.            Nonlin writes  the  plot  to  the  PRN  device  which  much  be
  1032.            attached  to  an  HP  Series  II  or  Series  III printer.  The
  1033.            NONLIN.LJF font file must be in the current directory or  in  a
  1034.            directory specified by the NONLIN environment variable.
  1035.  
  1036.        NOPAUSE  --  do  not  pause after the plot is displayed.  Normally,
  1037.            Nonlin pauses after displaying a plot  to  allow  you  time  to
  1038.            examine  it;  you  press  Enter  to continue execution once you
  1039.            have finished looking at the plot.  The NOPAUSE  option  causes
  1040.            Nonlin  to  continue  with  execution without pausing after the
  1041.            plot is displayed.  This is  useful  in  conjunction  with  the
  1042.            PRINT  option  when  Nonlin is run in a batch file and you want
  1043.            to generate a hardcopy plot but  not  pause  after  the  screen
  1044.            display.
  1045.  
  1046.        The  option  keywords may be abbrievated to their first letter.  If
  1047.        more than one option is specified, separate them with commas.   For
  1048.        example,  to  produce  a  plot  with  both  grid lines and residual
  1049.        lines, use the following command:
  1050.  
  1051.             PLOT GRID,RESIDUAL
  1052.  
  1053.        3.16 RPLOT
  1054.  
  1055.        RPLOT [options] (optional)  --  Display  a  plot  of  the  residual
  1056.        values.   A "residual" value (or error deviation) is the difference
  1057.        between  an  actual  value  of  the  dependent  variable   for   an
  1058.        observation  and  the  predicted value based on the function fitted
  1059.        by the regression analysis.  If  the  calculated  function  exactly
  1060.        predicted  the  actual  observation  values,  all  of  the residual
  1061.        values would be zero.  However, this is usually not  the  case  and
  1062.        the  residual  values  show  where,  and  by  how  much, the fitted
  1063.        function fails to predict the actual observations.
  1064.  
  1065.        The RPLOT command causes Nonlin  to  display  a  plot  showing  the
  1066.        residual  values  on  the  vertical  (Y)  axis.  If there is only a
  1067.        single independent variable it  is  used  for  the  horizontal  (X)
  1068.        axis.   However,  if  there  is more than one independent variable,
  1069.        you can use the "V=variable" option to specify  which  variable  to
  1070.        use  on the X axis.  If there is more than one independent variable
  1071.        and you do not use the "V" option,  Nonlin  displays  the  residual
  1072.        values  on  the vertical (Y) axis and the dependent variable values
  1073.        on the  horizontal  (X)  axis.   The  plot  title  indicates  which
  1074.        variable was used for the X axis.
  1075.  
  1076.        A  residual  plot is very useful for determining if the form of the
  1077.        function being fitted is appropriate for the data values.   If  the
  1078.        residual  values  are randomly distributed in positive and negative
  1079.        directions  then  the  form  (shape)  of  the  fitted  function  is
  1080.        probably  appropriate  for  the  data and the deviations are due to
  1081.        random measurement errors.   If,  however,  the  residuals  show  a
  1082.        systematic  pattern such as a periodic cycle, then the function may
  1083.        not be appropriate for the data values.  See the discussion of  the
  1084.  
  1085.        Chapter 3. Nonlin Commands                                       19
  1086.  
  1087.  
  1088.        Durbin-Watson  statistic  in  Section  4.9, page 24, for additional
  1089.        information  about  autocorrelated  residual  values.   The   PLOT,
  1090.        RPLOT,  and  NPLOT  commands  may be used in the same command file.
  1091.        Press Return to proceed with the analysis after you  have  finished
  1092.        looking at the plot.
  1093.  
  1094.        The following options may be specified on the RPLOT command:
  1095.  
  1096.        PRINT  -- print a copy of the plot on an HP LaserJet printer.  This
  1097.            option is only available in the registered version  of  Nonlin.
  1098.            Nonlin  writes  the  plot  to  the  PRN  device  which  much be
  1099.            attached to an HP Series II or Series III printer.
  1100.  
  1101.        NOPAUSE -- do not pause after the  plot  is  displayed.   Normally,
  1102.            Nonlin  pauses  after  displaying  a  plot to allow you time to
  1103.            examine it; you press Enter  to  continue  execution  once  you
  1104.            have  finished  looking at the plot.  The NOPAUSE option causes
  1105.            Nonlin to continue with execution  without  pausing  after  the
  1106.            plot is displayed.
  1107.  
  1108.        GRID -- Display grid lines on the plot.
  1109.  
  1110.        V=variable  --  specify  which  variable  is  to  be  used  for the
  1111.            horizontal (X) axis.   For  example,  V=YEAR  would  cause  the
  1112.            "YEAR" variable to be used for the X axis.
  1113.  
  1114.        The  option  keywords may be abbrievated to their first letter.  If
  1115.        more than one option is specified, separate them with commas.
  1116.  
  1117.        3.17 NPLOT
  1118.  
  1119.        NPLOT [options] (optional) -- Display a normal probability plot  of
  1120.        the  residual  values.   In  this  plot,  the  actual value of each
  1121.        residual is plotted on the  vertical  (Y)  axis  and  the  expected
  1122.        value   of  the  residual,  assuming  the  residuals  are  normally
  1123.        distributed, is  plotted  on  the  horizontal  (X)  axis.   If  the
  1124.        residuals  are  normally  distributed, the resulting plot will be a
  1125.        straight line passing through the origin with a slope of  1  (i.e.,
  1126.        the  actual  value of each residual should equal the expected value
  1127.        from the normal distribution).  If the residuals are  not  normally
  1128.        distributed, the plot will deviate from a straight line.
  1129.  
  1130.        This   plot  also  computes  the  correlation  between  the  actual
  1131.        residual  values  and  their  expected  values  and  displays   the
  1132.        correlation  coefficient  in  the  title  line  "(r=n.nn)".  If the
  1133.        residual values are normally distributed,  the  correlation  should
  1134.        be  close  to  1.00.   A  correlation value less than 0.94 suggests
  1135.        that the residuals are not normally distributed.
  1136.  
  1137.        The NPLOT command may be used  even  if  there  is  more  than  one
  1138.        independent  variable.   The PLOT, RPLOT, and NPLOT commands may be
  1139.        used in the same command file.  Press Return to  proceed  with  the
  1140.        analysis after you have finished looking at the plot.
  1141.  
  1142.        Chapter 3. Nonlin Commands                                       20
  1143.  
  1144.  
  1145.        The following options may be specified on the NPLOT command:
  1146.  
  1147.        GRID -- display grid lines to make it easier to estimate values.
  1148.  
  1149.        PRINT  -- print a copy of the plot on an HP LaserJet printer.  This
  1150.            option is only available in the registered version  of  Nonlin.
  1151.            Nonlin  writes  the  plot  to  the  PRN  device  which  much be
  1152.            attached to an HP Series II or Series III printer.
  1153.  
  1154.        NOPAUSE -- do not pause after the plot is displayed.
  1155.  
  1156.        The option keywords may be abbrievated to their first  letter.   If
  1157.        more than one option is specified, separate them with commas.
  1158.  
  1159.        DOMAIN  lowvalue,highvalue  (optional) -- Specifies the domain over
  1160.        which the plot is to be generated.   If  the  DOMAIN  statement  is
  1161.        omitted,  the  domain  of  the independent variable is used for the
  1162.        plot.  The DOMAIN statement can be used to generate a plot  of  the
  1163.        fitted  function  extrapolated  over the specified domain.  You can
  1164.        also use the DOMAIN command to restrict the domain  and  "zero  in"
  1165.        on  a  particular  range  of the function.  The DOMAIN command only
  1166.        affects the  PLOT  command;  it  does  not  affect  the  regression
  1167.        calculation or the RPLOT or NPLOT commands.
  1168.  
  1169.        3.18 PRESOLUTION
  1170.  
  1171.        PRESOLUTION  value (optional) -- Specifies whether plots sent to HP
  1172.        LaserJet printers should use 150 or  300  dot-per-inch  resolution.
  1173.        This  option is only available in the registered version of Nonlin.
  1174.        The value parameter must be 150 or 300.  The default value  is  150
  1175.        causes  the  plots to use most of the horizontal width of an 8.5x11
  1176.        inch page.   These  plots  are  suitable  for  direct  transfer  to
  1177.        overhead   transparencies.    Specifying  300  for  the  resolution
  1178.        produces smaller plots that are suitable for inclusion  in  printed
  1179.        documents.
  1180.  
  1181.        3.19 WIDTH
  1182.  
  1183.        WIDTH  value (optional) -- Specify the width, in inches, of printed
  1184.        plots.  This option is only available in the registered version  of
  1185.        Nonlin.   Due  to memory space considerations, the maximum width is
  1186.        limited to about 7.9 inches for 150 DPI resolution and  4.5  inches
  1187.        for  300 DPI resolution.  If you have limited memory space, you may
  1188.        have to reduce the width to  be  able  to  produce  printed  plots.
  1189.        This  statement  is  ignored  unless  you  request  that  a plot be
  1190.        printed.
  1191.  
  1192.        3.20 NOECHO
  1193.  
  1194.        NOECHO (optional) --  Specifies  that  the  commands  and  computed
  1195.        results  are  not  to be listed on the screen.  The output is still
  1196.        written to the listing file and any requested plots  are  displayed
  1197.        on the screen.
  1198.  
  1199.        Chapter 3. Nonlin Commands                                       21
  1200.  
  1201.  
  1202.        3.21 DATA
  1203.  
  1204.        DATA   [file]   (required)  --  Specifies  the  name  of  the  file
  1205.        containing the data records, or introduces the data  records  which
  1206.        follow  the  command.   If  a  file  name  is specified on the DATA
  1207.        command, the file is opened, its data records  are  read,  and  the
  1208.        regression  analysis  is  performed.   If  a file name is specified
  1209.        without an extension, ".DAT" is used by default.
  1210.  
  1211.        If no file name is specified on the DATA command, the data  records
  1212.        must immediately follow the DATA command in the command file.
  1213.  
  1214.        Each  data  record must contain at least as many data values as the
  1215.        number of variables specified on  the  VARIABLES  command(s).   The
  1216.        order  of  the variables as specified on the VARIABLES command must
  1217.        match the order of  the  values  in  each  observation.   Any  data
  1218.        values  beyond  those  required  for  the  specified  variables are
  1219.        ignored.  Each observation must begin on a new line.
  1220.  
  1221.        The data values must be separated by one or more  spaces  and/or  a
  1222.        comma.    Data  values  may  contain  decimal  points  and  may  be
  1223.        expressed  in  exponential  notation  (i.e.,  n.nnnnEppp).   As   a
  1224.        convenience  for  entering  time values, if a value contains one or
  1225.        more colons, the portion to the left of the colon is multiplied  by
  1226.        60.   For  example, 1:00 is equivalent to 60; 1:00:00 is equivalent
  1227.        to 3600.
  1228.  
  1229.        You may continue data lines by specifying a semicolon as  the  last
  1230.        non-blank  character  on a record and then placing the continuation
  1231.        value on the following line(s).
  1232.  
  1233.        The DATA command must be the last command in the command file.   If
  1234.        no  file  name  is  specified on the DATA command, the data records
  1235.        must immediately follow the DATA command in the command file.   The
  1236.        following  is  an example of a complete command file including data
  1237.        records:
  1238.  
  1239.             VARIABLES AGE,MILES,VALUE
  1240.             PARAMETERS BASE,DEPAGE,DEPMILES
  1241.             FUNCTION VALUE = BASE + DEPAGE*AGE + DEPMILES*MILES
  1242.             DATA
  1243.             2  10000  13000
  1244.             4  42000   9000
  1245.             1   7000  17000
  1246.             6  52000   6000
  1247.             5  48000   8000
  1248.  
  1249.        If the data records had  been  placed  in  a  separate  file  named
  1250.        CAR.DAT, the DATA statement would be changed to "DATA CAR.DAT".
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.                                     Chapter 4
  1258.  
  1259.                             Understanding The Results
  1260.  
  1261.  
  1262.  
  1263.  
  1264.        4.1 Descriptive Statistics for Variables
  1265.  
  1266.        Nonlin  prints a variety of statistics at the end of each analysis.
  1267.        For each variable, Nonlin lists  the  minimum  value,  the  maximum
  1268.        value,  the  mean  value,  and  the standard deviation.  You should
  1269.        confirm that these values are within the ranges you expect.
  1270.  
  1271.        4.2 Parameter Estimates
  1272.  
  1273.        For each parameter, Nonlin displays the initial parameter  estimate
  1274.        (which  you  specified  on the PARAMETER command, or 1 by default),
  1275.        the final (maximum likelihood) estimate, the standard error of  the
  1276.        estimated   parameter   value,  the  "t"  statistic  comparing  the
  1277.        estimated parameter value with zero, and the significance of the  t
  1278.        statistic.    Nine   significant   digits  are  displayed  for  the
  1279.        parameter estimates.  If you need to determine  the  parameters  to
  1280.        greater precision, use the POUTPUT command.
  1281.  
  1282.        The  final  estimate  parameter  values  are  the  results  of  the
  1283.        analysis.   By  substituting  these  values  in  the  equation  you
  1284.        specified  to  be fitted to the data, you will have a function that
  1285.        can be used to predict the value of the  dependent  variable  based
  1286.        on  a set of values for the independent variables.  For example, if
  1287.        the equation being fitted is
  1288.  
  1289.             y = p0 + p1*x
  1290.  
  1291.        and the final estimates are 1.5 for p0  and  3  for  p1,  then  the
  1292.        equation
  1293.  
  1294.             y = 1.5 + 3*x
  1295.  
  1296.        is  the best equation of this form that will predict the value of y
  1297.        based on the value of x.
  1298.  
  1299.        4.3 t Statistic
  1300.  
  1301.        The "t" statistic is computed by dividing the  estimated  value  of
  1302.        the  parameter  by its standard error.  This statistic is a measure
  1303.        of the likelihood that the actual value of  the  parameter  is  not
  1304.        zero.   The  larger  the  absolute value of t, the less likely that
  1305.        the actual value of the parameter could be zero.
  1306.  
  1307.  
  1308.  
  1309.                                        22
  1310.  
  1311.        Chapter 4. Understanding The Results                             23
  1312.  
  1313.  
  1314.        4.4 Prob(t)
  1315.  
  1316.        The "Prob(t)" value is the probability of obtaining  the  estimated
  1317.        value  of the parameter if the actual parameter value is zero.  The
  1318.        smaller the value of Prob(t), the more  significant  the  parameter
  1319.        and  the  less likely that the actual parameter value is zero.  For
  1320.        example, assume the estimated value of a parameter is 1.0  and  its
  1321.        standard  error  is 0.7.  Then the t value would be 1.43 (1.0/0.7).
  1322.        If the computed Prob(t) value was 0.05  then  this  indicates  that
  1323.        there  is  only  a  0.05  (5%)  chance that the actual value of the
  1324.        parameter could be zero.   If  Prob(t)  was  0.001  this  indicates
  1325.        there  is  only  1 chance in 1000 that the parameter could be zero.
  1326.        If Prob(t) was 0.92 this indicates that there is a 92%  probability
  1327.        that  the actual value of the parameter could be zero; this implies
  1328.        that the term of the regression equation containing  the  parameter
  1329.        can  be  eliminated without significantly affecting the accuracy of
  1330.        the regression.
  1331.  
  1332.        The t statistic probability is computed  using  a  two-sided  test.
  1333.        The  CONFIDENCE  command  can  be  used  to  cause  Nonlin to print
  1334.        confidence intervals for parameter values.  The SQUARE.NLR  example
  1335.        regression  includes  an  extraneous parameter (p0) whose estimated
  1336.        value is much smaller than its standard error;  the  Prob(t)  value
  1337.        is  0.99982  indicating  that  there is a high probability that the
  1338.        value is zero.
  1339.  
  1340.        4.5 Final Sum of Squared Deviations
  1341.  
  1342.        In addition to the variable and parameter values,  Nonlin  displays
  1343.        several  statistics  that  indicate  how well the equation fits the
  1344.        data.  The "Final sum of squared deviations"  is  the  sum  of  the
  1345.        squared  differences  between  the  actual  value  of the dependent
  1346.        variable for each  observation  and  the  value  predicted  by  the
  1347.        function, using the final parameter estimates.
  1348.  
  1349.        4.6 Average and Maximum Deviation
  1350.  
  1351.        The  "Average  deviation"  is  the average over all observations of
  1352.        the absolute value of the difference between the  actual  value  of
  1353.        the dependent variable and its predicted value.
  1354.  
  1355.        The   "Maximum  deviation  for  any  observation"  is  the  maximum
  1356.        difference (ignoring sign) between the actual and  predicted  value
  1357.        of the dependent variable for any observation.
  1358.  
  1359.        4.7 Proportion of Variance Explained
  1360.  
  1361.        The  "Proportion  of  variance  explained (R^2)" indicates how much
  1362.        better the function  predicts  the  dependent  variable  than  just
  1363.        using  the  mean  value  of  the  dependent variable.  This is also
  1364.        known  as  the  "coefficient  of  multiple  determination."  It  is
  1365.        computed  as  follows:  Suppose  that we did not fit an equation to
  1366.        the  data  and  ignored  all  information  about  the   independent
  1367.        variables  in  each observation.  Then, the best prediction for the
  1368.        dependent variable value for any  observation  would  be  the  mean
  1369.  
  1370.        Chapter 4. Understanding The Results                             24
  1371.  
  1372.  
  1373.        value  of  the  dependent  variable  over  all  observations.   The
  1374.        "variance" is the sum of the squared differences between  the  mean
  1375.        value   and   the   value   of  the  dependent  variable  for  each
  1376.        observation.  Now, if we use our fitted  function  to  predict  the
  1377.        value  of the dependent variable, rather than using the mean value,
  1378.        a second kind of variance can be computed by taking the sum of  the
  1379.        squared  difference  between  the  value  of the dependent variable
  1380.        predicted by the function and the  actual  value.   Hopefully,  the
  1381.        variance  computed by using the values predicted by the function is
  1382.        better (i.e., a smaller value) than  the  variance  computed  using
  1383.        the   mean  value.   The  "Proportion  of  variance  explained"  is
  1384.        computed as 1 - (variance using predicted value  /  variance  using
  1385.        mean).   If  the function perfectly predicts the observed data, the
  1386.        value of this statistic will be 1.00 (100%).  If the function  does
  1387.        no  better  a  job  of predicting the dependent variable than using
  1388.        the mean, the value will be 0.00.
  1389.  
  1390.        4.8 Adjusted Coefficient of Multiple Determination
  1391.  
  1392.        The "adjusted coefficient of multiple determination (Ra^2)"  is  an
  1393.        R^2  statistic  adjusted  for  the  number  of  parameters  in  the
  1394.        equation and the  number  of  data  observations.   It  is  a  more
  1395.        conservative   estimate  of  the  percent  of  variance  explained,
  1396.        especially when the sample size is small compared to the number  of
  1397.        parameters.  It is computed using the formula:
  1398.  
  1399.             Ra^2 = 1 - (n-1)/(n-p) * (1-R^2)
  1400.  
  1401.        where  'n'  is  the  number  of  observations, 'p' is the number of
  1402.        parameters, and 'R^2' is the  unadjusted  coefficient  of  multiple
  1403.        determination.
  1404.  
  1405.        4.9 Durbin-Watson Statistic
  1406.  
  1407.        The  "Durbin-Watson  test  for autocorrelation" is a statistic that
  1408.        indicates the likelihood that the deviation (error) values for  the
  1409.        regression   have  a  first-order  autoregression  component.   The
  1410.        regression  models   assume   that   the   error   deviations   are
  1411.        uncorrelated.
  1412.  
  1413.        In  business  and  economics,  many regression applications involve
  1414.        time series data.  If a non-periodic function, such as  a  straight
  1415.        line,  is  fitted  to  periodic data the deviations have a periodic
  1416.        form and are positively correlated over time; these deviations  are
  1417.        said    to    be   "autocorrelated"   or   "serially   correlated."
  1418.        Autocorrelated deviations may also indicate that the  form  (shape)
  1419.        of  the  function being fitted is inappropriate for the data values
  1420.        (e.g., a linear equation fitted to quadratic data).
  1421.  
  1422.        If the deviations are autocorrelated, there  may  be  a  number  of
  1423.        consequences  for the computed results: 1) The estimated regression
  1424.        coefficients no longer have the minimum variance property;  2)  the
  1425.        mean  square  error  (MSE) may seriously underestimate the variance
  1426.        of  the  error  terms;  3)  the  computed  standard  error  of  the
  1427.        estimated  parameter  values  may  underestimate  the true standard
  1428.  
  1429.        Chapter 4. Understanding The Results                             25
  1430.  
  1431.  
  1432.        error, in which case the t values and confidence intervals  may  be
  1433.        incorrect.   Note  that  if  an  appropriate  periodic  function is
  1434.        fitted to periodic data, the deviations from  the  regression  will
  1435.        be  uncorrelated  because the cycle of the data values is accounted
  1436.        for by the fitted function.
  1437.  
  1438.        Small values of the Durbin-Watson statistic indicate  the  presence
  1439.        of   autocorrelation.    Consult  significance  tables  in  a  good
  1440.        statistics book for exact interpretations; however,  a  value  less
  1441.        than  0.80  usually  indicates  that autocorrelation is likely.  If
  1442.        the Durbin-Watson statistic indicates that the residual values  are
  1443.        autocorrelated,  it  is  recommended  that you use the RPLOT and/or
  1444.        NPLOT commands to display a plot of the residual values.
  1445.  
  1446.        If an NPLOT command is used to produce a  normal  probability  plot
  1447.        of  the  residuals, the correlation between the residuals and their
  1448.        expected  values  (assuming  they  are  normally  distributed)   is
  1449.        printed   in   the   listing.    If   the  residuals  are  normally
  1450.        distributed,  the  correlation  should  be  close   to   1.00.    A
  1451.        correlation  less  than  0.94  suggests  that the residuals are not
  1452.        normally distributed.
  1453.  
  1454.        4.10 Analysis of Variance Table
  1455.  
  1456.        An "Analysis of  Variance"  table  provides  statistics  about  the
  1457.        overall significance of the model being fitted.
  1458.  
  1459.  
  1460.  
  1461.  
  1462.  
  1463.  
  1464.                                     Chapter 5
  1465.  
  1466.                                Theory of Operation
  1467.  
  1468.  
  1469.  
  1470.  
  1471.        5.1 Minimization Algorithm
  1472.  
  1473.        Nonlin  uses  a model/trust-region technique along with an adaptive
  1474.        choice of the  model  Hessian.   The  algorithm  is  essentially  a
  1475.        combination   of   Gauss-Newton  and  Levenberg-Marquardt  methods;
  1476.        however, the  adaptive  algorithm  often  works  much  better  than
  1477.        either of these methods alone.
  1478.  
  1479.        The  basis  for  the  minimization  technique  used by Nonlin is to
  1480.        compute the sum of the squared residuals for one set  of  parameter
  1481.        values  and  then slightly alter each parameter value and recompute
  1482.        the sum of squared residuals to see how the parameter value  change
  1483.        affects  the  sum  of  the  squared  residuals.   By  dividing  the
  1484.        difference between the original and new  sum  of  squared  residual
  1485.        values  by  the amount the parameter was altered, Nonlin is able to
  1486.        determine the approximate partial derivative with  respect  to  the
  1487.        parameter.   This  partial  derivative  is used by Nonlin to decide
  1488.        how to alter the value of the parameter for the next iteration.
  1489.  
  1490.        If the function being modeled is well  behaved,  and  the  starting
  1491.        value  for the parameter is not too far from the optimum value, the
  1492.        procedure will eventually converge to the  best  estimate  for  the
  1493.        parameter.   This  procedure  is carried out simultaneously for all
  1494.        parameters  and  is,   in   fact,   a   minimization   problem   in
  1495.        n-dimensional space, where 'n' is the number of parameters.
  1496.  
  1497.        For  a  much  more detailed explanation of the regression algorithm
  1498.        used by Nonlin see ACM Transactions on  Mathematical  Software  7,3
  1499.        (Sept.   1981)  "Dennis,  J.E.,  Gay, D.M., and Welsch, R.E.  -- An
  1500.        adaptive nonlinear least-squares algorithm."
  1501.  
  1502.        5.2 Convergence Criterion
  1503.  
  1504.        Nonlin has several convergence criterion that  stop  the  iterative
  1505.        minimization  procedure.   The  TOLERANCE  command  can  be used to
  1506.        alter the convergence tolerance value.
  1507.  
  1508.        Two internal variables are used to determine when  convergence  has
  1509.        occurred.   RFCTOL  has a default value of 1E-10 and can be altered
  1510.        by use of the TOLERANCE command.  AFCTOL has  a  default  value  of
  1511.        1E-20  and  is  only  altered by the TOLERANCE command if the value
  1512.        specified is less than the default value.  In the discussion  which
  1513.  
  1514.  
  1515.  
  1516.                                        26
  1517.  
  1518.        Chapter 5. Theory of Operation                                   27
  1519.  
  1520.  
  1521.        follows  the  "function  value"  is  half  the  sum  of the squared
  1522.        residuals computed using the current parameter estimates.
  1523.  
  1524.        "Relative  function  convergence"  is  reported  if  the  predicted
  1525.        maximum  possible  function  reduction  is  at  most RFCTOL*ABS(F0)
  1526.        where F0 is  the  function  value  at  the  start  of  the  current
  1527.        iteration,  and  if  the  last step attempted achieved no more than
  1528.        twice the predicted function decrease.
  1529.  
  1530.        "Absolute function convergence" is reported if the  function  value
  1531.        is less than AFCTOL.
  1532.  
  1533.  
  1534.  
  1535.  
  1536.  
  1537.  
  1538.                                     Chapter 6
  1539.  
  1540.                               Hints for Nonlin Use
  1541.  
  1542.  
  1543.  
  1544.  
  1545.        6.1 Convergence Failures
  1546.  
  1547.        One   of  the  potential  problems  that  confronts  any  nonlinear
  1548.        minimization  procedure  is  non-convergence.   Non-convergence  is
  1549.        usually  not  a  problem  for regressions using a linear model, but
  1550.        becomes  a  more  serious  consideration  when  using   complicated
  1551.        nonlinear   functions;   increasing   the   number   of  parameters
  1552.        aggravates the problem.
  1553.  
  1554.        Non-convergence can occur in two ways: the solution may diverge  or
  1555.        it  may  converge  to  the wrong solution -- a local minimum rather
  1556.        than the global minimum.  Periodic  functions,  such  as  sin,  and
  1557.        cos,  are particularly prone to convergence problems.  For example,
  1558.        consider a nonlinear regression performed with the function:
  1559.  
  1560.             y = offset + amplitude * sin(frequency * x)
  1561.  
  1562.        where x and y are variables, and offset, amplitude,  and  frequency
  1563.        are  the  parameters  whose  values  are  to be determined.  If the
  1564.        starting value  for  frequency  is  not  reasonably  close  to  the
  1565.        correct  value,  the solution may converge to a harmonic (multiple)
  1566.        or subharmonic (fundamental) value of  the  frequency.   A  command
  1567.        file  named  SINE.NLR  is  supplied  with  the commands and data to
  1568.        perform this analysis.
  1569.  
  1570.        The SWEEP command can  be  very  useful  in  cases  like  the  sine
  1571.        example.   In  the  SINE.NLR  example analysis, the actual value of
  1572.        the frequency is 3; the function converges to the correct  solution
  1573.        if  the  starting  value is in the range 2.6 to 3.3.  However, this
  1574.        example  is  quite  insensitive  to  the  starting  value  of   the
  1575.        amplitude  parameter.   With  an  actual  value  of  2, the correct
  1576.        solution is found  with  starting  values  from  1  through  10000.
  1577.        Similarly,  the  offset parameter, which had an actual value of 10,
  1578.        was successfully determined with starting values ranging from 1  to
  1579.        over 50000.
  1580.  
  1581.        Another  example  which  is sensitive to a parameter starting value
  1582.        is  POWER.NLR  which  attempts  to  determine  the  values  of  the
  1583.        parameters p0, p1, and p2 for the function
  1584.  
  1585.             y = p0 + p1*x^p2
  1586.  
  1587.  
  1588.  
  1589.  
  1590.                                        28
  1591.  
  1592.        Chapter 6. Hints for Nonlin Use                                  29
  1593.  
  1594.  
  1595.        (where  "x^p2"  means  x raised to the p2 power).  The actual value
  1596.        of p2 in the example data is 2; the  solution  converges  correctly
  1597.        if  the  starting  value of p2 is in the range 1.8 to 3.8.  As with
  1598.        the other example, the solution is relatively  insensitive  to  the
  1599.        starting values of p0 and p1.
  1600.  
  1601.        6.2 Singular Matrix Problems
  1602.  
  1603.        Another  possible  problem  is  that the analysis may stop with the
  1604.        message "Singular convergence.   Mutually  dependent  parameters?".
  1605.        This  is  usually  due  to  one  of  two  things:  (1)  a redundant
  1606.        parameter that is co-dependent with another  parameter,  or  (2)  a
  1607.        situation  where  the value of one parameter "blocks" the effect of
  1608.        other  parameters.   As  an  example  of  a  redundant   parameter,
  1609.        consider the function
  1610.  
  1611.             y = p0 + p1*p2*x
  1612.  
  1613.        This  is  a simple linear equation except there are two parameters,
  1614.        p1, and p2, which are both factors to the variable  x.   It  should
  1615.        be  clear  that  there  is no unique solution to this problem since
  1616.        any value of p1 is possible if the right value  of  p2  is  chosen.
  1617.        Similarly, the function
  1618.  
  1619.             y = p0 + p1 + p2*x
  1620.  
  1621.        has  no  unique  solution  since  either  p0  or  p1  is redundant.
  1622.        Similarly, in the equation
  1623.  
  1624.             y = p0 + p1*exp(x+p2)
  1625.  
  1626.        either p1 or p2 is redundant.
  1627.  
  1628.        The second type of singular matrix problem can  be  illustrated  by
  1629.        the function
  1630.  
  1631.             y = p0 + p1*x^p2
  1632.  
  1633.        If,  during  the  solution  process,  p1 takes on the value 0, then
  1634.        varying the value of p2 has no effect on the  equation  and  Nonlin
  1635.        cannot  figure  out  which  way  to  change the value of p2 to move
  1636.        toward convergence.  The solution to this problem is  to  assign  a
  1637.        starting  value  that  is  not  zero  to  p1, and use the CONSTRAIN
  1638.        command to force p1 to remain non-zero.
  1639.  
  1640.        6.3 Performance Issues
  1641.  
  1642.        Nonlin is carefully programmed  and  compiled  with  an  optimizing
  1643.        compiler  for  maximum  performance.   However,  Nonlin  is  a real
  1644.        "number  cruncher,"  and  the  nonlinear  regression  algorithm  is
  1645.        mathematically  very  elaborate.   During  each  iteration,  Nonlin
  1646.        computes  gradients,  Jacobians,  Hessians,  and  eigenvalues,  and
  1647.        performs  QR  and Cholesky matrix decompositions.  All calculations
  1648.        are carried out using double precision (64 bit) floating point.
  1649.  
  1650.        Chapter 6. Hints for Nonlin Use                                  30
  1651.  
  1652.  
  1653.        Nonlin does not require  an  80x87  numeric  coprocessor,  but  its
  1654.        performance  is  greatly  enhanced  if one is present.  In fact, an
  1655.        8088 CPU with an 8087 numeric coprocessor  can  perform  regression
  1656.        analyses  faster  than  a  20  MHz  80386  that  does  not  have  a
  1657.        coprocessor.  If  you  have  an  8088  without  a  coprocessor,  be
  1658.        patient -- Nonlin is probably giving it the workout of its life.
  1659.  
  1660.        Very  long  running  times  can result if you use the SWEEP command
  1661.        with many starting values.  The problem is compounded if  you  have
  1662.        multiple  SWEEP  commands.   If  you use the SWEEP command to try a
  1663.        large number of starting parameter values, you  can  save  time  by
  1664.        using   the  ITERATIONS  command  to  specify  a  small  number  of
  1665.        iterations (such as  5)  during  the  initial  attempt  to  find  a
  1666.        solution.   Once  a  feasible  set of starting parameter values has
  1667.        been determined, remove the SWEEP  command,  specify  the  starting
  1668.        values   on   the   PARAMETERS  command,  increase  the  number  of
  1669.        iterations, and rerun the analysis to get the final result.
  1670.  
  1671.        6.4 Program Limits
  1672.  
  1673.        The following is a summary of the Nonlin program limitations:
  1674.  
  1675.             Maximum number of variables = 20
  1676.             Maximum number of parameters = 25
  1677.             Maximum length of variable or parameter names = 10
  1678.  
  1679.        The maximum number of data  observations  that  Nonlin  can  handle
  1680.        depends  on  the  number  of  parameters as shown by the table that
  1681.        follows:
  1682.  
  1683.             # Parameters    Max Observations
  1684.                   1               2019
  1685.                   2               1611
  1686.                   3               1339
  1687.                   4               1144
  1688.                   5                997
  1689.                   6                883
  1690.                   7                791
  1691.                   8                715
  1692.                   9                652
  1693.                  10                599
  1694.  
  1695.        A commercial version of Nonlin that can handle more  variables  and
  1696.        parameters is available.  Contact the author for information.
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.                                     Chapter 7
  1704.  
  1705.                                 Example Analyses
  1706.  
  1707.  
  1708.  
  1709.  
  1710.        A  number  of  example  regression analysis files are provided with
  1711.        your Nonlin distribution.  All of the example  command  files  have
  1712.        the  extension  ".NLR".   Some  of the important ones are described
  1713.        below, others contain comment lines that explain what they do.
  1714.  
  1715.        LINEAR.NLR -- Simple linear regression with  plotted  function  and
  1716.            data.
  1717.  
  1718.        QUAD.NLR  --  Fit  a quadratic equation.  Plot the function and the
  1719.            data.
  1720.  
  1721.        ASYMPTOT.NLR -- Fit an asymptotic function Y = 12 - 10/X.
  1722.  
  1723.        AIDS.NLR -- A logistic curve  is  a  growth  curve  used  to  model
  1724.            functions  which  increase  gradually at first, more rapidly in
  1725.            the middle growth period, and slowly at the end,  leveling  off
  1726.            at  a  maximum  value  after some period of time.  This type of
  1727.            curve is frequently used to model  biological  growth  patterns
  1728.            where  there  is  an initial exponential growth period followed
  1729.            by a leveling off as more of the population is infected  or  as
  1730.            the  food  supply  or  some other factor limits further growth.
  1731.            The form of the symmetric logistic growth function is:
  1732.  
  1733.                 y = k / (1 + exp(a + b*x))
  1734.  
  1735.            where 'k', 'a', and 'b' are parameters  that  shape  and  scale
  1736.            the function.  The value of 'b' is negative.
  1737.  
  1738.            The  AIDS.NLR  example  fits  a logistic curve to the number of
  1739.            new cases of AIDS reported in  the  United  States  during  the
  1740.            period  1981 through 1992.  The computed function fits the data
  1741.            remarkably  well  showing  that  the  AIDS  infection  rate  is
  1742.            following  a  classic  logistic  curve  and should level off at
  1743.            about 47,500 new cases per year (in the  United  States).   The
  1744.            DOMAIN  command is used to cause Nonlin to extrapolate the plot
  1745.            of the function through 1995.
  1746.  
  1747.        F33.NLR -- Multivariate linear  regression  (multiple  regression).
  1748.            Calculate  the value of a used Beech F33 Bonanza airplane using
  1749.            a linear model based on its age, the number  of  hours  on  its
  1750.            airframe,  and  the number of hours on its engine.  The t value
  1751.            and Prob(t) indicate that the number of  hours  on  the  engine
  1752.            ('Engdep'  parameter)  is  not  significant  to  the regression
  1753.  
  1754.  
  1755.                                        31
  1756.  
  1757.        Chapter 7. Example Analyses                                      32
  1758.  
  1759.  
  1760.            model; the other parameters are significant but airframe  hours
  1761.            is less significant than the base price and age of the plane.
  1762.  
  1763.        F33YEAR.NLR  --  Similar to F33.NLR except the price of the Bonanza
  1764.            is calculated based on a linear function of only the age.
  1765.  
  1766.        F33EXP.NLR -- Similar to F33YEAR.NLR except a negative  exponential
  1767.            function  is  used  rather than a linear function.  Compare the
  1768.            fit of this model with that of the F33YEAR.NLR example.
  1769.  
  1770.        SINE.NLR -- Fit an equation involving a sin  function.   The  SWEEP
  1771.            command is used to find a starting point that will converge.
  1772.  
  1773.        SQUARE.NLR  --  Fit  a  sine series to a square wave.  Note in this
  1774.            example that the 'p0' parameter, which represents the  constant
  1775.            term  of  the  equation, has an estimated value of 9.22715E-006
  1776.            (very nearly zero) and a standard  error  of  0.0398754.   This
  1777.            yields  a  t  value of nearly zero and Prob(t) of 0.99982 which
  1778.            means that there is a 99.982% chance that the actual  value  of
  1779.            p0  may be zero (it is in fact zero).  This illustrates how you
  1780.            can  use  the  t  value  and  Prob(t)  to  identify  extraneous
  1781.            parameters.
  1782.  
  1783.        COOLING.NLR  --  Fit an equation involving an exponential function.
  1784.            If a heated object is allowed to cool, the rate of  cooling  at
  1785.            any  instant  is  proportional  to  the  difference between the
  1786.            object's temperature and the ambient  (room)  temperature.   In
  1787.            other  words, an object cools faster at first, while it is hot,
  1788.            and the rate of cooling slows down as the  temperature  of  the
  1789.            object  approaches  the ambient temperature.  The function that
  1790.            relates the object's temperature to time is:
  1791.  
  1792.                 Temperature = Roomtemp+InitTemp*exp(-Coolrate*Time)
  1793.  
  1794.            Where InitTemp is the number of degrees above room  temperature
  1795.            at  time  0,  and Coolrate is a factor that depends on the mass
  1796.            of the  object,  how  well  it  is  insulated,  etc.   The  exp
  1797.            function  is  the  value of e (2.7182818...) raised to a power.
  1798.            The COOLING.NLR example determines the parameters InitTemp  and
  1799.            Coolrate  to  fit  an  equation  of  this form to some data the
  1800.            author collected.
  1801.  
  1802.        BOIL.NLR -- The boiling point of water decreases  as  the  pressure
  1803.            in  the  vessel  containing  the water decreases.  "Clapeyron's
  1804.            equation" shows that the boiling point is related  to  pressure
  1805.            according to the following function:
  1806.  
  1807.                 Temperature = b / log(Pressure/a) - 459.7
  1808.  
  1809.            Where   'Temperature'  is  in  degrees  Fahrenheit  (the  459.7
  1810.            constant converts degrees  Fahrenheit  to  degrees  Rankine  --
  1811.            relative  to  absolute zero), 'Pressure' is the pressure in the
  1812.            vessel  in  pounds  per  square  inch,  and  'a'  and  'b'  are
  1813.            parameters  whose  values  are  to be determined.  The data for
  1814.  
  1815.        Chapter 7. Example Analyses                                      33
  1816.  
  1817.  
  1818.            this example was collected by the author's son  for  a  science
  1819.            project.
  1820.  
  1821.        MAGNET.NLR  --  Fit  a  function  involving  an  arc  tangent and a
  1822.            variable to the third power.  This is  an  interesting  physics
  1823.            problem.   If  a  magnet  is  placed due east of a compass, the
  1824.            deflection of the compass needle from north  is  equal  to  the
  1825.            arc  tangent of the ratio of the strength of the magnet's field
  1826.            relative to the earth's magnetic field.  The  strength  of  the
  1827.            magnet's  field at the compass is inversely proportional to the
  1828.            cube of the distance from the magnet  to  the  compass.   Thus,
  1829.            the function relating these terms is
  1830.  
  1831.                 Deflection = deg(atan(Strength / Distance ^ 3))
  1832.  
  1833.            The  deg  function converts an angle in radians to degrees.  In
  1834.            the example, Deflection and Distance  are  the  variables,  and
  1835.            the value of the Strength parameter is determined.
  1836.  
  1837.        DIODE.NLR  --  The current through a diode increases sharply as the
  1838.            voltage across  the  diode  is  increased.   An  equation  that
  1839.            approximates the current flow as a function of the voltage is:
  1840.  
  1841.                 I = exp(b*(V-c))
  1842.  
  1843.            where  'I' is the current, 'V' is the voltage, and 'b', and 'c'
  1844.            are parameters that  are  to  be  estimated  by  the  nonlinear
  1845.            regression.
  1846.  
  1847.        AVLTIME.NLR  -- An AVL tree is a balanced binary tree used to store
  1848.            information in a computer's memory.  Because the entries in  an
  1849.            AVL  tree  are  kept in sorted order, and the tree is kept in a
  1850.            balanced form, it is possible to rapidly find any entry in  the
  1851.            tree.   The  time required to create an AVL tree with N entries
  1852.            is approximately equal to:
  1853.  
  1854.                 Time = a + b*N*log2(N)
  1855.  
  1856.            where 'a' is a constant term equal to the overhead involved  in
  1857.            starting  and  completing  a tree creation, and 'b' is a growth
  1858.            coefficient that depends on the speed  of  the  computer.   The
  1859.            log2(N)  function  is  the  log  base  2  of  N  (the number of
  1860.            entries).  The AVLTIME.NLR example fits an equation to  a  data
  1861.            set  that relates the time in seconds required to create an AVL
  1862.            tree with the number of entries in the tree.
  1863.  
  1864.        PIECE.NLR -- Piecewise linear function.  Fit a function  consisting
  1865.            of  two linear pieces that bend at X=5.  When X is less than 5,
  1866.            the slope of the function is B1.  When X  is  greater  than  or
  1867.            equal  to  5,  the  slope  is  B2.   B0  is  the Y value of the
  1868.            function at X=5 (i.e., at  the  pivot  point).   The  step(a,x)
  1869.            function  returns  the  value  0  when  x  is less than 'a'; it
  1870.            returns 1 when x is greater than or equal to 'a'.
  1871.  
  1872.  
  1873.  
  1874.  
  1875.  
  1876.  
  1877.                                     Chapter 8
  1878.  
  1879.                               Special Applications
  1880.  
  1881.  
  1882.  
  1883.  
  1884.        8.1 Omitted Dependent Variable
  1885.  
  1886.        There is a class of nonlinear regression problems that can be  best
  1887.        expressed  by  omitting  the dependent variable (i.e., the variable
  1888.        on the left of the equal sign).   To  understand  what  this  means
  1889.        first   consider  the  normal  regression  case  with  a  dependent
  1890.        variable.  For each observation the function is evaluated  and  the
  1891.        computed  value  is  subtracted from the corresponding value of the
  1892.        dependent variable for that observation.  This  residual  value  is
  1893.        then  squared  and added to the other squared residual values.  The
  1894.        goal is to minimize the total sum of  squared  residuals.   In  the
  1895.        case  where  the  dependent  variable  is  omitted, the function is
  1896.        computed for each observation and the  value  of  the  function  is
  1897.        squared  (i.e.,  it  is  treated  as the residual) and added to the
  1898.        other squared values.  The goal is  to  minimize  the  sum  of  the
  1899.        squared  values  of  the  function.   Thus,  for  a perfect fit the
  1900.        computed value of the  function  for  every  observation  would  be
  1901.        zero.
  1902.  
  1903.        To  perform  this  type of analysis omit the dependent variable and
  1904.        equal sign from the left side of the function specification.
  1905.  
  1906.        As an example of this type of  analysis  consider  the  problem  of
  1907.        fitting  a  circle  to a set of points that form a roughly circular
  1908.        pattern (i.e., a "circular regression").  Our goal is to  determine
  1909.        the  center  point  of  the circle (Xc,Yc) and the radius (R) which
  1910.        will make the circle best fit the points so that  the  sum  of  the
  1911.        squared  distances  between  the  points  and  the perimeter of the
  1912.        circle is minimized (the points are as close to  the  perimeter  of
  1913.        the circle as possible).
  1914.  
  1915.        For  this  problem  we have three parameters whose values are to be
  1916.        determined: Xc, Yc, and R.  There will be one data observation  for
  1917.        each  point  to  which  the circle is being fitted.  For each point
  1918.        there are two variables, Xp and Yp, the X and Y coordinates of  the
  1919.        point's position.
  1920.  
  1921.        Since  our  goal  is  to  minimize the sum of the squared distances
  1922.        from the points to the perimeter of the circle, we need a  function
  1923.        that  will  compute this distance for each point.  If the center of
  1924.        the circle is at (Xc,Yc) and the position of  a  point  is  (Xp,Yp)
  1925.        then,  from  the  theorem  of Pythagoras, we know the distance from
  1926.        the center to the point is
  1927.  
  1928.  
  1929.                                        34
  1930.  
  1931.        Chapter 8. Special Applications                                  35
  1932.  
  1933.  
  1934.             SQRT((Xp-Xc)^2 + (Yp-Yc)^2)
  1935.  
  1936.        But we are interested in the distance from  the  perimeter  to  the
  1937.        point.   Since the radius of the circle is R, the distance from the
  1938.        perimeter to the point (along a straight line from  the  center  to
  1939.        the point) is
  1940.  
  1941.             SQRT((Xp-Xc)^2 + (Yp-Yc)^2) - R
  1942.  
  1943.        That  is,  the distance from the perimeter to the point is equal to
  1944.        the distance from the center to the point less  the  distance  from
  1945.        the  center  to  the  perimeter (the radius).  The distance will be
  1946.        positive or negative depending on whether the point is  outside  or
  1947.        inside  the  circle  but  this  does  not matter since the value is
  1948.        squared as part of the minimization process.
  1949.  
  1950.        The Nonlin statements for this analysis are as follows:
  1951.  
  1952.             VARIABLES  Xp,Yp
  1953.             PARAMETERS Xc,Yc,R
  1954.             FUNCTION   SQRT((Xp-Xc)^2 + (Yp-Yc)^2) - R
  1955.  
  1956.        Note that there is no dependent variable or equal sign to the  left
  1957.        of   the  function.   Nonlin  will  determine  the  values  of  the
  1958.        parameters Yp, Yc, and R such that the sum of  the  squared  values
  1959.        of  the  function  (i.e.,  the  sum  of  the  squared distances) is
  1960.        minimized.  The CIRCLE.NLR file contains a  full  example  of  this
  1961.        analysis.
  1962.  
  1963.        As  a second example similar to the first one, consider a town that
  1964.        is trying to decide where to place a fire  station.   The  location
  1965.        should  be  central such that the sum of the squared distances from
  1966.        the station to each house is minimized.   Nonlin  can  be  used  to
  1967.        determine  the  coordinates  of  the station (Xc,Yc) given a set of
  1968.        coordinates for each house location (Xh,Yh)  by  using  a  slightly
  1969.        simpler function than the first example:
  1970.  
  1971.             FUNCTION  SQRT((Xh-Xc)^2 + (Yh-Yc)^2)
  1972.  
  1973.  
  1974.        8.2 Root Finding and Expression Minimization
  1975.  
  1976.        Although  it  is designed for nonlinear regression analysis, Nonlin
  1977.        can also be used to find the root (zero point) or minimum  absolute
  1978.        value  of  a  nonlinear  expression.  To use Nonlin in this fashion
  1979.        follow these steps:
  1980.  
  1981.          . Do not use any VARIABLE statements.
  1982.  
  1983.          . Use PARAMETER statements to  specify  the  names  and  optional
  1984.            starting  values  for  the  parameters  whose  values are to be
  1985.            determined as the roots or minimum value of the expression.
  1986.  
  1987.          . Use the FUNCTION statement  to  specify  the  expression  whose
  1988.            roots  or  minimum  value  is  to  be  found;  do NOT specify a
  1989.  
  1990.        Chapter 8. Special Applications                                  36
  1991.  
  1992.  
  1993.            dependent  variable  and  equal  sign  --  specify   only   the
  1994.            expression that is to be minimized.
  1995.  
  1996.          . Do  not  include  any data records after the DATA statement; it
  1997.            simply signals the end of  the  command  file  and  causes  the
  1998.            analysis to begin.
  1999.  
  2000.        The  following  is  an example command file to find the root of the
  2001.        expression SIN(X)-LOG(X):
  2002.  
  2003.             PARAMETER X
  2004.             FUNCTION SIN(X) - LOG(X)
  2005.             DATA
  2006.  
  2007.        Notice that the "variable" in the expression, X,  is  not  declared
  2008.        to  be a variable but rather a parameter.  This example is included
  2009.        in the file MINSL.NLR which you can run.
  2010.  
  2011.        For this type of analysis, Nonlin  determines  the  values  of  the
  2012.        parameters  that minimize the absolute value of the expression.  If
  2013.        the expression has a zero value  (i.e.,  a  root),  that  value  is
  2014.        found  since  that is the smallest possible absolute value.  If the
  2015.        expression does not  have  a  zero  point,  Nonlin  determines  the
  2016.        values  of  the parameters that produce the smallest absolute value
  2017.        of the expression.  For example, the expression  2*x^2-3*x+10  does
  2018.        not  have  a  root  but  reaches a minimum value of 8.875 when x is
  2019.        0.75.  The MINPAROB.NLR command file contains this example.
  2020.  
  2021.        There are a number of cautions that you should keep  in  mind  when
  2022.        using Nonlin to find roots or minimum values:
  2023.  
  2024.          . Nonlin  will  find only one root or minimum value per analysis.
  2025.            For example, the expression 9-x^2 has two  roots:  -3  and  +3.
  2026.            Nonlin  will  find one of the roots; which one it finds depends
  2027.            on the starting value specified for X.
  2028.  
  2029.          . Nonlin will find only real roots, not complex.
  2030.  
  2031.          . If the expression contains a local minimum, Nonlin may find  it
  2032.            rather  than the global minimum or root.  Of course, if you are
  2033.            looking for a local minimum in a certain region this  could  be
  2034.            considered    a   feature.    For   example,   the   expression
  2035.            0.5*x^3+5*(x-2)^2+15 has a local minimum at x=1.61 and  a  root
  2036.            at  x=-13.38.  If the starting value of x is less than -8.3 the
  2037.            root is found; if the starting value is greater than -8.3,  the
  2038.            local  minimum  is  found.   If  the expression contains only a
  2039.            single  variable,  use  the  Mathplot  program  to  graphically
  2040.            display  the expression and determine a good starting value for
  2041.            the variable (see page  40  for  additional  information  about
  2042.            Mathplot).   The SWEEP command can also be used to try multiple
  2043.            starting values when searching for a global minimum.
  2044.  
  2045.        Chapter 8. Special Applications                                  37
  2046.  
  2047.  
  2048.        8.2.1 Function Minimization Examples
  2049.  
  2050.        MINFALL.NLR -- The time  taken  for  an  object  to  slide  down  a
  2051.            frictionless  guide  from  position  (0,h)  to another position
  2052.            (d,0) (i.e.,  falling  through  a  distance  'h'  while  moving
  2053.            horizontally  a  distance  'd')  depends  on  the path that the
  2054.            object takes as it follows the guide.  It turns  out  that  the
  2055.            path  that  minimizes  the  descent time is not a straight line
  2056.            from  (0,h)  to   (d,0)   but   rather   a   curve   called   a
  2057.            brachistochrone  with  a steeper slope near the beginning, that
  2058.            gives the object a chance to accelerate  quickly,  and  then  a
  2059.            shallower slope further on.
  2060.  
  2061.            Finding  the  shape  of  this curve is a classic problem in the
  2062.            branch of mathematics called the Calculus of  Variations.   The
  2063.            MINFALL  example  solves  a  simpler  case of this problem: the
  2064.            object slides along  a  straight  guide  from  (0,1000)  to  an
  2065.            intermediate  position (px,py), and then along another straight
  2066.            guide  from  (px,py)  to  (1000,0).    What   point,   (px,py),
  2067.            minimizes the descent time?
  2068.  
  2069.            Note  concerning the answer: The fall time for the object if it
  2070.            follows a straight guide from (0,1000) to  (1000,0)  is  2.0203
  2071.            seconds;  the fall time if it follows the two straight segments
  2072.            found by MINFALL is 1.8748; the fall time  if  it  follows  the
  2073.            ideal  curved  brachistochrone  is  1.8590.   The  speed of the
  2074.            object at the end of the fall is the  same  regardless  of  the
  2075.            path taken (conservation of energy).
  2076.  
  2077.        MINFUEL.NLR  -- A lunar lander is hovering above the surface of the
  2078.            moon looking for a suitable landing site.   Available  fuel  is
  2079.            critical  and  the  desired  site is 200 meters away.  How long
  2080.            should the horizontal thruster be fired to start and  stop  the
  2081.            motion  over  the  ground?   The vertical thruster must be used
  2082.            continuously to keep  the  lander  from  being  pulled  to  the
  2083.            surface.    If   too  little  horizontal  thrust  is  used  the
  2084.            spacecraft will move slowly and much fuel will be  consumed  by
  2085.            the    vertical    thruster   counterbalancing   the   downward
  2086.            gravitational pull while hovering over  the  surface.   On  the
  2087.            other  hand,  if  the  horizontal  thruster is fired for a long
  2088.            time,  the  spacecraft  will  move  quickly   (minimizing   the
  2089.            hovering  time)  but  excessive  fuel  will  be used during the
  2090.            horizontal   acceleration   and   deceleration.     MINFUEL.NLR
  2091.            determines  how  long  the  thruster should be fired during the
  2092.            start  and  stop  accelerations  such  that  the   total   fuel
  2093.            consumption (start thrust + stop thrust + hover) is minimized.
  2094.  
  2095.  
  2096.  
  2097.  
  2098.  
  2099.  
  2100.                                     Chapter 9
  2101.  
  2102.                         Acknowledgement and Use of Nonlin
  2103.  
  2104.  
  2105.  
  2106.  
  2107.        9.1 Acknowledgement
  2108.  
  2109.        The  nonlinear regression algorithm used by Nonlin was published in
  2110.        ACM  Transactions  on  Mathematical  Software  7,3  (Sept.    1981)
  2111.        "Dennis,  J.E.,  Gay,  D.M.,  and  Welsch,  R.E.   --  An  adaptive
  2112.        nonlinear least-squares algorithm."
  2113.  
  2114.        9.2 Use and Distribution of Nonlin
  2115.  
  2116.        There are  two  versions  of  the  Nonlin  program:  shareware  and
  2117.        registered.   You  are  welcome  to  make  copies  of the shareware
  2118.        version of Nonlin and pass them on to friends or post this  program
  2119.        on  bulletin  boards  or  distribute  it  via disk catalog services
  2120.        provided  the  entire  Nonlin  distribution  is  included  in   its
  2121.        original,  unmodified  form.  A distribution fee may be charged for
  2122.        the cost of the diskette, shipping and handling.   However,  Nonlin
  2123.        may  not  be sold, or incorporated in another product that is sold,
  2124.        without  the  permission  of  Phillip  H.   Sherrod.   Vendors  are
  2125.        encouraged  to contact the author to get the most recent version of
  2126.        Nonlin.
  2127.  
  2128.        As a shareware product, you are granted a no-cost, trial period  of
  2129.        30  days  during which you may evaluate Nonlin.  If you find Nonlin
  2130.        to be useful, educational, and/or  entertaining,  and  continue  to
  2131.        use  it  beyond  the  30  day  trial  period,  you  are required to
  2132.        compensate the author by sending the registration form  printed  at
  2133.        the   end   of   this  document  (and  in  REGISTER.DOC)  with  the
  2134.        appropriate registration fee to  help  cover  the  development  and
  2135.        support of Nonlin.
  2136.  
  2137.        In  return  for  registering,  you  will  be authorized to continue
  2138.        using Nonlin beyond  the  trial  period  and  you  will  receive  a
  2139.        registered  version  of the program, a laser-printed, bound manual,
  2140.        and three months of support via  telephone,  mail,  or  CompuServe.
  2141.        Your  registration  fee will be refunded if you encounter a serious
  2142.        bug that cannot be corrected.
  2143.  
  2144.        The registered version of Nonlin omits the  shareware  notification
  2145.        screen  at the start of the run and does not require you to press a
  2146.        key to proceed with the  analysis.   The  registered  version  also
  2147.        includes  the  ability to print plots on HP LaserJet printers.  The
  2148.        registered version of Nonlin  is  NOT  shareware  and  may  not  be
  2149.        redistributed or used on more than one computer system.
  2150.  
  2151.  
  2152.                                        38
  2153.  
  2154.        Chapter 9. Acknowledgement and Use of Nonlin                     39
  2155.  
  2156.  
  2157.        The  author  frequently  improves  Nonlin and it is likely that the
  2158.        version you have is not the most recent version.   Note,  the  cost
  2159.        of  registering  Nonlin  is  insignificant  compared  with what you
  2160.        would have to pay to  purchase  a  commercial  statistical  package
  2161.        with an equivalent regression capability.
  2162.  
  2163.        9.3 Association of Shareware Professionals
  2164.  
  2165.        This  program  is  produced  by  a  member  of  the  Association of
  2166.        Shareware Professionals (ASP).  ASP wants to  make  sure  that  the
  2167.        shareware  principle works for you.  If you are unable to resolve a
  2168.        shareware-related problem with an  ASP  member  by  contacting  the
  2169.        member  directly,  ASP  may be able to help.  The ASP Ombudsman can
  2170.        help you resolve a dispute or problem with an ASP member, but  does
  2171.        not  provide technical support for members' products.  Please write
  2172.        to the ASP Ombudsman at 545 Grover  Road,  Muskegon,  MI  49442  or
  2173.        send  a  CompuServe  message  via  CompuServe Mail to ASP Ombudsman
  2174.        7007,3536.
  2175.  
  2176.        You are welcome to contact the author:
  2177.  
  2178.                                Phillip H. Sherrod
  2179.                                 4410 Gerald Place
  2180.                          Nashville, TN  37205-3806  USA
  2181.                              615-292-2881 (evenings)
  2182.                              CompuServe: 76166,2640
  2183.                        Internet: 76166.2640@compuserve.com
  2184.  
  2185.        9.4 Copyright Notice
  2186.  
  2187.        Both  the  Nonlin  program  and  documentation  are  copyright  (c)
  2188.        1992-1993  by  Phillip  H.   Sherrod.   You  are  not authorized to
  2189.        modify the program.  "Nonlin" is a trademark.
  2190.  
  2191.        9.5 Disclaimer
  2192.  
  2193.        Nonlin is provided "as is" without warranty  of  any  kind,  either
  2194.        expressed   or  implied.   This  program  may  contain  "bugs"  and
  2195.        inaccuracies, and its results should not be assumed to  be  correct
  2196.        unless  they are verified by independent means.  The author assumes
  2197.        no  responsibility  for  the  use  of  Nonlin  and  will   not   be
  2198.        responsible for any damage resulting from its use.
  2199.  
  2200.  
  2201.  
  2202.  
  2203.  
  2204.  
  2205.                                    Chapter 10
  2206.  
  2207.                                  Other Software
  2208.  
  2209.  
  2210.  
  2211.  
  2212.        10.1 Mathplot -- Mathematical Function Plotting Program
  2213.  
  2214.        If  you  like  Nonlin, you should check out the Mathplot program by
  2215.        the same author.
  2216.  
  2217.        Mathplot allows you to specify complicated  mathematical  functions
  2218.        using  ordinary  algebraic  expressions  and immediately plot them.
  2219.        Four types of  functions  may  be  specified:  cartesian  (Y=f(X));
  2220.        parametric  cartesian (Y=f(T) and X=f(T)); polar (Radius=f(Angle));
  2221.        and parametric polar (Radius=f(T)  and  Angle=f(T)).   Up  to  four
  2222.        functions  may  be  plotted  simultaneously.  Scaling is automatic.
  2223.        Options are available to control axis display and labeling as  well
  2224.        as  grid  lines.   Hard  copy  output  may  be generated as well as
  2225.        screen  display.   Mathplot  is  an  ideal  tool   for   engineers,
  2226.        scientists,  math  and  science teachers, and anyone else who needs
  2227.        to quickly visualize mathematical functions.
  2228.  
  2229.        If you register Nonlin and order Mathplot at  the  same  time,  you
  2230.        can get both for $40.
  2231.  
  2232.        10.2 TSX-32 -- Multi-User Operating System
  2233.  
  2234.        If  you  have  a  need  for  a  multi-user, multi-tasking operating
  2235.        system, you should look into TSX-32.  TSX-32  is  a  full-featured,
  2236.        high  performance,  multi-user operating system for the 386 and 486
  2237.        that  provides  both  32-bit  and  16-bit  program  support.   With
  2238.        facilities  such  as  multitasking  and  multisessions, networking,
  2239.        virtual memory, X-Windows, background batch queues,  data  caching,
  2240.        file   access  control,  real-time,  and  dial-in  support,  TSX-32
  2241.        provides a solid environment for a wide range of applications.
  2242.  
  2243.        A two user, shareware version of TSX-32  called  TSX-Lite  is  also
  2244.        available.
  2245.  
  2246.        TSX-32  is  not a limited, 16-bit, multi-DOS add-on.  Rather, it is
  2247.        a complete 32-bit operating system which  makes  full  use  of  the
  2248.        hardware's  potential,  including protected mode execution, virtual
  2249.        memory, and demand paging.  TSX-32 sites range from  small  systems
  2250.        with  2-3  terminals  to  large  installations  with  more  than 64
  2251.        terminals on a single 386.
  2252.  
  2253.  
  2254.  
  2255.  
  2256.  
  2257.                                        40
  2258.  
  2259.        Chapter 10. Other Software                                       41
  2260.  
  2261.  
  2262.        In addition to supporting most popular 16-bit DOS programs,  TSX-32
  2263.        also  provides a 32-bit "flat" address space with both Phar Lap and
  2264.        DPMI compatible modes of execution.
  2265.  
  2266.        Since the DOS file  structure  is  standard  for  TSX-32,  you  can
  2267.        directly  read  and  write DOS disks.  And, you can run DOS part of
  2268.        the time and TSX-32 the rest of the time on the same computer.
  2269.  
  2270.        TSX-32 allows each user to control up  to  10  sessions.   Programs
  2271.        can  also  "fork"  subtasks  for  multi-threaded applications.  The
  2272.        patented Adaptive Scheduling Algorithm provides  consistently  good
  2273.        response time under varying conditions.
  2274.  
  2275.        The   TSX-32  network  option  provides  industry  standard  TCP/IP
  2276.        networking through Ethernet and serial lines.  Programs can  access
  2277.        files  on  remote  machines as easily as on their own machine.  The
  2278.        SET HOST command allows a user on one machine to log  onto  another
  2279.        computer  in  the  network.  FTP, Telnet, and NFS are available for
  2280.        interoperability with other systems.
  2281.  
  2282.        TSX-32 is, quite simply,  the  best  and  most  powerful  operating
  2283.        system  available  for the 386 and 486.  For additional information
  2284.        contact:
  2285.  
  2286.                            S&H Computer Systems, Inc.
  2287.                              1027 17th Avenue South
  2288.                              Nashville, TN 37212 USA
  2289.                               615-327-3670 (voice)
  2290.                                615-321-5929 (fax)
  2291.                               CompuServe: 71333,27
  2292.                         Internet: 71333.27@compuserve.com
  2293.  
  2294.  
  2295.        10.3 SIMSTAT -- Interactive Statistics Program
  2296.  
  2297.        If you need a general-purpose statistical package, or would like  a
  2298.        menu-oriented,  mouse-aware  interface to Nonlin, I suggest you try
  2299.        the SIMSTAT program written by Normand Peladeau.
  2300.  
  2301.        SIMSTAT is a menu driven statistical  program  that  provides  many
  2302.        basic   descriptive  and  comparative  statistics  and  includes  a
  2303.        "bridge" module to allow it to function as a "front end"  and  data
  2304.        editor for Nonlin.
  2305.  
  2306.        The  shareware  version  of  SIMSTAT  is  available from the IBMAPP
  2307.        forum of CompuServe and from many  BBS,  or  you  can  contact  the
  2308.        author  at  the  address  below.   SIMSTAT  version 2.1 or later is
  2309.        required for use with Nonlin.  You  must  also  have  the  "bridge"
  2310.        module  called  SIM2NL.  SIM2NL.ZIP is included on the distribution
  2311.        disk with the registered version of Nonlin.
  2312.  
  2313.        For information about SIMSTAT, contact: Normand Peladeau,  Provalis
  2314.        Research,   5000   Adam  Street,  Montreal,  QC  H1V  1W5,  Canada,
  2315.        Compuserve: [71760,2103], Internet: 71760.2103@compuserve.com.
  2316.  
  2317.          ===============================================================
  2318.                                Software Order Form
  2319.          ===============================================================
  2320.  
  2321.        Name ______________________________________________________
  2322.  
  2323.        Address ___________________________________________________
  2324.  
  2325.        City _______________________  State _______ Zip ___________
  2326.  
  2327.        Country ____________________  Telephone ___________________
  2328.  
  2329.        CompuServe account (optional) _____________________________
  2330.  
  2331.        Nonlin version ____________________________________________
  2332.  
  2333.        Bulletin board where you found Nonlin _____________________
  2334.  
  2335.        Comments __________________________________________________
  2336.  
  2337.        Check the box below which indicates your order type:
  2338.  
  2339.            ___ I wish to register Nonlin ($25).
  2340.  
  2341.            ___ I wish to order Mathplot ($20).
  2342.  
  2343.            ___ I wish to register Nonlin and order Mathplot ($40).
  2344.  
  2345.        Add $5 to any amount shown above if the software is  being  shipped
  2346.        out  of  the  United  States.   I  cannot accept checks from non-US
  2347.        banks.  Visa, MasterCard and American Express credit  card  charges
  2348.        are  accepted  but  a check, money order, or cash is preferred.  If
  2349.        you wish to use a credit card specify the  billing  name,  address,
  2350.        card number, and expiration date.
  2351.  
  2352.        In  return for registering, you will receive the registered version
  2353.        of the program, a laser-printed, bound  copy  of  the  manual,  and
  2354.        three   months   of   telephone   or   CompuServe   support.   Your
  2355.        registration fee will be refunded if you find a  serious  bug  that
  2356.        cannot be corrected.
  2357.  
  2358.        Distribution disk choice (check one):
  2359.  
  2360.              3.50" HD (1.4 MB)  ______
  2361.              5.25" HD (1.2 MB)  ______
  2362.              5.25" DD (360 KB)  ______
  2363.  
  2364.        Send this form with the amount indicated to the author:
  2365.  
  2366.                                Phillip H. Sherrod
  2367.                                 4410 Gerald Place
  2368.                           Nashville, TN  37205-3806 USA
  2369.  
  2370.                              615-292-2881 (evenings)
  2371.                              CompuServe: 76166,2640
  2372.                        Internet: 76166.2640@compuserve.com
  2373.  
  2374.        Index                                                            43
  2375.  
  2376.  
  2377.        80x87 coprocessor, 30              DATA command, 21
  2378.        ABS function, 7                    DEG function, 7
  2379.        Absolute converge, 27              Degrees to radians, 9
  2380.        Acknowledgement, 38                Deviation
  2381.        ACOS function, 7                      average, 23
  2382.        Adaptive algorithm, 26                definition, 2
  2383.        AFCTOL value, 26                      maximum, 23
  2384.        AIDS growth curve, 31              Diode current example, 33
  2385.        Arc cosine function, 7             Disclaimer, 39
  2386.        Arc sine function, 7               DPMI support, 40
  2387.        Arc tangent function, 7            Durbin-Watson statistic, 24
  2388.        Arighmetic operators, 6            E constant, 6
  2389.        ASIN function, 7                   EI2 function, 7
  2390.        ASP, 39                            EIC1 function, 7
  2391.        Assn. of Shareware Prof., 39       EIC2 function, 8
  2392.        Asymptotic function example,       EL1 function, 7
  2393.                 31                        Elliptic integral function, 7,
  2394.        ATAN function, 7                            8
  2395.        Author address, 39                 ERF function, 8
  2396.        Autoregression test, 19, 24        Examples, 31
  2397.        Average deviation, 23                 AIDS growth curve, 31
  2398.        AVL tree example, 33                  asymptotic function, 31
  2399.        Bessel function, 8, 10                AVL tree, 33
  2400.        Beta function, 7                      boiling water, 32
  2401.        BETAI function, 7                     cooling, 32
  2402.        Brachistochrone, 37                   diode current, 33
  2403.        Build-in functions, 7                 function minimization, 37
  2404.        Built-in constants, 6                 linear regression, 31
  2405.        Calculus of variations, 37            lunar lander, 37
  2406.        Chebyshev function, 10                magnet force, 33
  2407.        Circular regression, 34               minimum time path, 37
  2408.        Clapeyron's equation, 32              multivariate, 31
  2409.        Command files, 10                     negative exponential, 32
  2410.        Commands, 12                          piecewise function, 33
  2411.        Comments in command files, 10         quadratic equation, 31
  2412.        Compass to polar, 7                   square wave, 32
  2413.        CompuServe, 39, 41                    SWEEP command, 32
  2414.        CONFIDENCE command, 13, 23         EXP function, 8
  2415.        Confidence intervals, 13           Exponentation operator, 6
  2416.        CONSTANT command, 6, 13            Expression minimization, 35
  2417.        CONSTRAIN command, 14, 29          FAC function, 8
  2418.        Continuation of lines, 10          Factorial function, 8
  2419.        Convergence criterion, 26          Fire station example, 35
  2420.           absolute, 27                    FUNCTION command, 15
  2421.           relative, 27                    Function minimization, 35
  2422.        Convergence failures, 28           Functions, 7
  2423.        Cooling example, 32                GAMMA function, 8
  2424.        Copyright notice, 39               GAMMAI function, 8
  2425.        COS function, 7                    GAMMALN function, 8
  2426.        Cosecant function, 7               Gauss-Newton algorithm, 26
  2427.        COSH function, 7                   Growth curve, 31
  2428.        COT function, 7                    HAV function, 8
  2429.        COVARIANCE command, 14             Hessian, 26
  2430.        CSC function, 7                    Hyperbolic cosine function, 7
  2431.        CTOP function, 7                   Hyperbolic sine function, 10
  2432.  
  2433.        Index                                                            44
  2434.  
  2435.  
  2436.        Hyperbolic tangent function,       Numeric constants, 6
  2437.                 10                        Numeric coprocessor, 30
  2438.        Incomplete beta function, 7        $OBS variable, 16
  2439.        Installing Nonlin, 3               Order form, 42
  2440.        Internet, 39, 41                   OUTPUT command, 16
  2441.        Inverse gamma function, 8          PARAMETER command
  2442.        ITERATIONS command, 15                function minimization, 35
  2443.        J0 function, 8                     PARAMETERS command, 12
  2444.        J1 function, 8                     PAREA function, 8
  2445.        JN function, 8                     Performance issues, 29
  2446.        LaserJet                           PI constant, 6
  2447.        LaserJet printer, 3, 38            Piecewise function example,
  2448.           resolution, 20                           33
  2449.        Least squares regression, 2        PLOT command, 17
  2450.        Levenberg-Marquardt, 26               options, 17
  2451.        Limits, 30                         Plots
  2452.        Linear regression, 1                  data and function, 17
  2453.           example, 31                        normal probability, 19
  2454.        Listing file, 5                       residual values, 18
  2455.        LOG function, 8                       resolution, 20
  2456.        Log gamma function, 8                 width of, 20
  2457.        LOG10 function, 8                  Polar to compass, 9
  2458.        LOG2 function, 8                   Polar to rectangular, 9
  2459.        Logistic curve, 31                 Polynomial equation example,
  2460.        Lunar lander example, 37                    31
  2461.        Magnet example, 33                 POUTPUT command, 17
  2462.        Marquardt algorithm, 26               extra precision output, 22
  2463.        Mathplot, 40                       $PREDICTED variable, 16
  2464.        MAX function, 8                    PRESOLUTION command, 20
  2465.        Maximum values, 22                 Prob(t) value, 23
  2466.        MIN function, 8                    Program limits, 30
  2467.        Minimiation algorithm, 26          PTOC function, 9
  2468.        Minimization problem, 35           PTORX function, 9
  2469.        Model/trust region, 26             PTORY function, 9
  2470.        Multi-user operating system,       PULSE function, 9
  2471.                 40                        Quadratic equation example,
  2472.        Multiple determination, 23                  31
  2473.        Multivariate regression, 31        RAD function, 9
  2474.        Mutually dependent, 29             Radian to degree conversion,
  2475.        Natural log function, 8                     7
  2476.        Negative exponential, 2, 32        Ra^2 statistic, 24
  2477.        Networking, 41                     Real-time, 40
  2478.        NOECHO command, 20                 Rectangular to polar, 9
  2479.        NONLIN environment variable,       REGISTER command, 16
  2480.                 3                         REGISTER.DOC file, 3
  2481.        NONLIN.DOC file, 3                 Registering Nonlin, 38
  2482.        NONLIN.EXE file, 3                 Registration form, 42
  2483.        NONLIN.FON file, 3, 17             Relative convergence, 27
  2484.        NONLIN.LJF file, 3                 Residual
  2485.        NORMAL function, 8                 Residual values
  2486.        Normal probablity plot, 19            plotting, 18
  2487.        NPD function, 8                    $RESIDUAL variable, 16
  2488.        NPLOT command, 19                     average, 23
  2489.           autocorrelation test, 25           definition, 2
  2490.           options, 20                        maximum, 23
  2491.  
  2492.        Index                                                            45
  2493.  
  2494.  
  2495.        RFCTOL value, 26
  2496.        Root finding, 35
  2497.        RPLOT command, 18
  2498.           autocorrelation test, 25
  2499.           options, 19
  2500.        RTOPA function, 9
  2501.        RTOPD function, 9
  2502.        R^2 statistic, 23
  2503.        S&H Computer Systems, Inc.,
  2504.                 41
  2505.        SEC function, 9
  2506.        Secant function, 9
  2507.        SEL function, 10
  2508.        SET command, 3
  2509.        Sherrod, Phillip H., 39
  2510.        SIM2NL, 41
  2511.        SIMSTAT, 41
  2512.        SIN function, 10
  2513.        Singular matrix problems, 29
  2514.        SINH function, 10
  2515.        SQRT function, 10
  2516.        Square wave example, 32
  2517.        Standard deviation, 22
  2518.        Standard error function, 8
  2519.        STEP function, 10
  2520.        Support of Nonlin, 38
  2521.        SWEEP command, 14
  2522.           convergence failure, 28
  2523.           example, 32
  2524.           function minimization, 36
  2525.           performance issues, 30
  2526.        Symbolic constants, 6
  2527.        T function, 10
  2528.        t statistic, 22, 23
  2529.        TAN function, 10
  2530.        TANH function, 10
  2531.        TCP/IP, 41
  2532.        Theory of operation, 26
  2533.        Time series data, 24
  2534.        TITLE command, 12
  2535.        TOLERANCE command, 15, 16
  2536.           converge criterion, 26
  2537.        TSX-32, 40
  2538.        TSX-Lite, 40
  2539.        Use and distribution, 38
  2540.        VARIABLES command, 12
  2541.        Variance-covariance matrix,
  2542.                 14
  2543.        Warranty, 39
  2544.        WIDTH command, 20
  2545.        X windows, 40
  2546.        Y0 function, 10
  2547.        Y1 function, 10
  2548.        YN function, 10
  2549.